vim

1
2
3
4
5
6
7
8
9
10
syntax on
set nu ts=4 sw=4 mouse=a cin
colo desert

map <F9> :call CR()<CR>
func! CR()
exec "w"
exec "!g++ -O2 -g -std=c++11 -Wno-unused-result % -o %<"
exec "! ./%<"
endfunc

对拍

Linux

duipai.sh

1
2
3
4
5
6
7
8
#!/bin/bash
while true; do
./maker > input.txt
./a < input.txt > ans.txt
./b < input.txt > out.txt
diff ans.txt out.txt
if [ $? -ne 0 ] ; then break; fi
done

Windows

duipai.bat

1
2
3
4
5
6
7
@echo off
:again
maker > input
a < input > ans.txt
b < input > out.txt
fc ans.txt out.txt > nul
if not errorlevel 1 goto again

Ubuntu

质因数分解

1
factor n