|
|
back to board1021 wrong answer Somebody can respond why incorrectly? On turbo pascal all tests passes. var a:array[1..1000] of integer; b:array[1..1000] of integer; i,j,n,m,r: integer; s1,s2,s: string; begin read(n); for i:=1 to n do readln(a[i]); for i:=1 to n-1 do if a[i]>a[i+1] then begin r:=a[i]; a[i]:=a[i+1]; a[i+1]:=r; end; read(m); for j:=1 to m do readln(b[j]); for j:=1 to m-1 do if a[j]<a[j+1] then begin r:=a[j+1]; a[j+1]:=a[j]; a[j]:=r; end; for i:=1 to n do for j:=1 to m do begin if ((a[i]+b[j])=10000)and((a[i]+b[j])<>10000) then s:='yes' else if (a[i]+b[j])=10000 then s1:='yes' else if (a[i]+b[j])<>10000 then s2:='no'; end; if s='yes' then writeln(s) else if s1='yes' then writeln(s1) else if s2='no' then writeln(s2); end. Edited by author 08.11.2009 20:44 Re: 1021 wrong answer You should output capital letters ("YES", "NO"). Re: 1021 wrong answer Time limit exceeded How to correct?=) How time depends? Edited by author 08.11.2009 21:27 |
|
|