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 1247. Check a Sequence

Time limit exceeded
Posted by Lincoln 27 Mar 2009 19:25
used:
...
for(i=1;i<=S;i++)
for(j=i;j<=S;j++)
...
But the result is 'Time limit exceeded'.  Please help, why 'Time limit exceeded'?
Re: Time limit exceeded
Posted by dmitri_quick 10 Aug 2009 20:46
don't use brute force... O(n^2) n=30000 ===>>> time limit)

hint: you can don't use N in your solution
Re: Time limit exceeded
Posted by rip&pvs 14 Jan 2015 23:00
brute force (with some optimizations) works fine