|
|
вернуться в форумNo TLE program Послано panfei 22 окт 2008 14:53 program ex(input,output); var a,b:array[0..50001] of longint; n,i,j,m:longint; begin read(n); for i:=1 to n do read(a[i]); read(m); for i:=1 to m do read(b[i]); j:=1; for i:=1 to n do begin if a[i]+b[1]<10000 then begin continue;end; while (a[i]+b[j]>10000) and (j+1<=m) do inc(j); if a[i]+b[j]=10000 then begin writeln('YES');halt;end; end; writeln('NO'); end. |
|
|