一些模版

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#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;
int n , m;
int A[MAXN];

void solve() {

}

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

然后是 vimrc (macvim 用的)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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()

文章作者: yijan
文章链接: https://yijan.co/template/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Yijan's Blog