Skip to content

Instantly share code, notes, and snippets.

View EarthMessenger's full-sized avatar

也吏 EarthMessenger

View GitHub Profile
@EarthMessenger
EarthMessenger / spider.py
Created January 2, 2024 13:24
crawl problems titles on cwoi
#!/usr/bin/env python3
import itertools
import requests
import time
CWOI_HOST = 'https://local.cwoi.com.cn:8443'
CWOI_TOKEN = ''
CRAWL_INTERVAL = 0.5
@EarthMessenger
EarthMessenger / circle.cpp
Created December 31, 2023 05:45
P5525 [Ynoi2012] WC2016 充满了失望
// long double
#define NDEBUG
#include <algorithm>
#include <iostream>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
so $VIMRUNTIME/vimrc_example.vim
set autoindent
set smartindent
set autochdir
set timeoutlen=200
set number
set relativenumber
set laststatus=2
@EarthMessenger
EarthMessenger / judge.sh
Last active October 16, 2023 12:57
judge.sh
#!/usr/bin/sh
print_usage_and_exit()
{
echo "Usage: $0 [-t <second>] <program>"
exit 1
}
time_limit=1
@EarthMessenger
EarthMessenger / log2.c
Created August 25, 2022 05:09
calculate log2
#include <stdio.h>
#define REPEAT0(x) x
#define REPEAT1(x) REPEAT0(x), REPEAT0(x)
#define REPEAT2(x) REPEAT1(x), REPEAT1(x)
#define REPEAT3(x) REPEAT2(x), REPEAT2(x)
#define REPEAT4(x) REPEAT3(x), REPEAT3(x)
#define REPEAT5(x) REPEAT4(x), REPEAT4(x)
#define REPEAT6(x) REPEAT5(x), REPEAT5(x)
#define REPEAT7(x) REPEAT6(x), REPEAT6(x)
@EarthMessenger
EarthMessenger / .clang-format
Last active March 3, 2023 15:13
my clang-format file
BasedOnStyle: LLVM
UseTab: Always
IndentWidth: 8
TabWidth: 8
BreakBeforeBraces: Mozilla
DerivePointerAlignment: false
PointerAlignment: Right
ColumnLimit: 80
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: true