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 1153. Supercomputer

What algorithm do you use?
It is necessary to take square root
It is possible to solve this problem using BS. So it looks like some optimization is required...
Alexey Look. (+) // Problem 1153. Supercomputer 14 Jul 2006 15:14
The first program did like this:
If c<0 then l:=n;
If c=0 then break;
If c>0 then r:=n;
Where l,n,r:array...;

Now I do like
If c<0 then swap(no1,no2);
If c=0 then break;
If c>0 then swap(no2,no3);
Where no1,no2,no3:byte;

ANW, TLE#8 in both cases.