Raisetsu41's Blog

「I will see your face down here real soon.」

Template

  • 缺省源
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
If the radiance of a thousand suns were to burst into the sky?
...that would be like the splendor of the mighty one.
*/
#include <bits/stdc++.h>
#define mp(x, y) make_pair(x, y)
#define all(v) (v).begin(), (v).end()
using i128 = __int128;
using i64 = long long;
using u64 = unsigned long long;

inline void solve() {

}

signed main() {
std::ios::sync_with_stdio(false);
std::cin.tie(0), std::cout.tie(0);

int T = 1;
// std::cin >> T;
while (T--) solve();
return 0;
}
  • 我的 Sublime C++ 14 配置
1
2
3
4
5
6
{
"shell_cmd": "cd {%raw%}${file_path} && gnome-terminal -- bash -c \"g++ ${%endraw%}{file} -o {%raw%}${file_base_name} -std=c++14 -O2 && /usr/bin/time ./${%endraw%}{file_base_name}; read a;\""
}
{
"shell_cmd": "cd {%raw%}${file_path} && gnome-terminal -- bash -c \"g++ ${%endraw%}{file} -o {%raw%}${file_base_name} -std=c++14 -g && gdb ${%endraw%}{file_base_name};\""
}
  • 编译脚本
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <bits/stdc++.h>
using namespace std;

signed main(int argc, const char* argv[]) {
assert(argc == 2);
clock_t bg, ed;
bg = clock();
system((string("d:\\mingw\\bin\\g++ ")+argv[1]+".cpp -std=c++14 -Wall -Wextra -Wl,--stack=998244353 -fno-ms-extensions -o"+argv[1]).c_str());
ed = clock();
printf("Compiled within: %ld ms\n", ed - bg);
bg = clock();
long ret = system(argv[1]);
ed = clock();
puts("\n============================");
printf("Program terminated in: %ld ms\n", ed-bg);
printf("Returns: %ld", ret);
}

  • vim config
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
36
37
38
39
40
41
42
syntax enable
syntax on

set laststatus=2
set number
set mouse-=a
set cursorline
set nobackup
set noswapfile
set showmatch
set autoread
set tabstop=2
set shiftwidth=2
set cindent
set clipboard=unnamed
set expandtab

inoremap ( ()<esc>i
inoremap [ []<esc>i
inoremap ' ''<esc>i
inoremap " ""<esc>i

colorscheme onedark

nnoremap <F6> :call CompileRun()<CR>
func! CompileRun()
exec "w"
exec '!g++ -std=c++14 -fno-ms-extensions -O2 % -o %<'
exec '!time ./%<'
endfunc

nnoremap <F5> :call CompileDebug()<CR>
func! CompileDebug()
exec "w"
exec '!g++ -std=c++14 -fno-ms-extensions -g % -o %<'
exec '!time gdb ./%<'
endfunc

nnoremap <F12> :call Clss()<CR>
func! Clss()
exec '!clear'
endfunc