|
|
вернуться в форумWhy I got WA? var sz:array[-50000..50000]of boolean; can:boolean; procedure init; var n,t:word; k:integer; begin fillchar(sz,sizeof(sz),0); readln(n); for t:=1 to n do begin readln(k); sz[10000-k]:=true; end; end; procedure make; var m,t:word; k:integer; begin can:=false; readln(m); for t:=1 to m do begin readln(k); if sz[k] then can:=true; end; end; procedure print; begin if can then writeln('YES') else writeln('NO'); end; begin init; end. Re: Why I got WA? in your program's init k is integer ,while k=-32767 or others then 10000-k is out of integer, it's answer is wrong! please check! |
|
|