Test 5

Posted by

jsd 29 Mar 2013 19:42

I've got WA:

Var a,b:array[1..1000]of longint;n,k,i,j,o:shortint;

begin

o:=0;

read(n);

for i:=1 to n do read(a[i]);

read(k);

for j:=1 to k do read(b[j]);

for i:=1 to n do

for j:=1 to k do

if a[i]+b[j]=10000 then o:=1;

if o=0 then write('NO');

if o=1 then write('YES');

end.

*Edited by author 29.03.2013 19:42*