PKU 2366 Sacrament of the sum
http://poj.org/problem?id=2366
inputとoutputしか読まなくていい感じの問題。
よく分からないTLEを喰らった。自前の入力をscanfにしたら直った。
よく分からない。
bool app[32767*3]; main(){ int n; bool ok=false; scanf("%d",&n); rep(i,n){ int t;scanf("%d",&t); app[t+32768]=true; } scanf("%d",&n); rep(i,n){ int t; scanf("%d",&t); ok|=app[10000-t+32768]; } puts(ok?"YES":"NO"); }