ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1021. Sacrament of the Sum

TLE, what's wrong
Posted by Rudnev Vladimir 27 Feb 2010 22:45
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
Posted by [SESC USU] Efanov N. 28 Feb 2010 16:33
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?))