|
|
back to boardTLE, what's wrong var b,a:array[1..50000]of int64; n,m,i,j:longint; begin readln(n); for i:=1 to n do readln(a[i]); readln(m); for j:=1 to m do readln(b[j]); for i:=1 to n do for j:=1 to m do if a[i]+b[j]=10000 then begin writeln('YES'); halt(0);end; writeln('NO'); end. Re: TLE, what's wrong n<=50000? m<=50000, 50000*50000=2 500 000 000, so in simple computer it is 2500 seconds, it is too long, isn't it?)) |
|
|