一些模版

头文件都嵌博客里有点难看,专门开一个文章放头文件和 vimrc 之类的东西吧。

#include "iostream"
#include "algorithm"
#include "cstring"
#include "cstdio"
#include "cmath"
#include "vector"
#include "map"
#include "set"
#include "queue"
using namespace std;
#define MAXN 200006
//#define int long long
#define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i)
#define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i)
#define pii pair<int,int>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define all(x) (x).begin() , (x).end()
#define mem( a ) memset( a , 0 , sizeof a )
typedef long long ll;
ll n , m;
int A[MAXN];

void solve() {

}

signed main() {
//    int T;cin >> T;while( T-- ) solve();
    solve();
}

然后是 vimrc (macvim 用的)

set encoding=utf-8
set nocompatible
syntax enable
colorscheme monokai
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
set tabstop=4
set shiftwidth=4
set lines=50 columns=85
set guifont=Source_Code_Pro:h30:cANSI
set autoindent
set nu
exec 'cd '.fnameescape('~/codes')  
set autochdir
map <tab> : call Compile_No_Warning()
func! Compile_No_Warning()
exec "w"
exec "!g++ % -o %<"
endfunc
map <F1> : call Run()
func! Run()
exec "!./%<"
endfunc
func! Compile_kotlin()
exec "w"
exec "!kotlinc % -include-runtime -d %<.jar"
endfunc
map <F3> : call Compile_kotlin()
\