ACM模板

0 其他

0.1 vimrc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
set ts=4 "tabstop
set sw=4 "shiftwidth
set sc "showcmd
set nu "number
set ru "ruler
set ai "autoindent
set mouse=a
filetype indent on

set et "expandtab
set smarttab
set autowrite

inoremap { {}<LEFT>
inoremap {<CR> {}<LEFT><CR><CR><UP><TAB>
inoremap } {<CR><ESC>A<CR>}<UP><ESC>A

map <F5> :w<CR>:!gdb %< -q <CR>
nmap <F9> :w<CR>:!g++ % -o %< -g -Wall -fsanitize=address<CR>
imap <F9> <ESC>:w<CR>:!g++ % -o %< -g -Wall -fsanitize=address<CR>
nmap <F10> :w<CR>:!time ./%< <CR>
imap <F10> <ESC>:w<CR>:!time ./%< <CR>

0.2 对拍

1
2
3
4
5
6
7
8
9
10
while true; do
./data > a.in
./a > a.out
./std > std.out
if diff a.out std.out; then
echo AC
else
exit 0
fi
done