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

My God, why do I allways have TLE#8?!?! Several programs don't pass this test. Any trick? Help. Thanks. (-)
Posted by Alexey 13 Jul 2006 15:13
Re: My God, why do I allways have TLE#8?!?! Several programs don't pass this test. Any trick? Help. Thanks. (-)
Posted by Kaliningrad SU -J_A_MES-HeadLiner 13 Jul 2006 22:13
What algorithm do you use?
It is necessary to take square root
I use Binnary Search to find N. I see that it works slow but to find sqrt I need BS too (-)
Posted by Alexey 14 Jul 2006 13:45
Re: I use Binnary Search to find N. I see that it works slow but to find sqrt I need BS too (-)
Posted by Samsonov Alex [USU] 14 Jul 2006 14:56
It is possible to solve this problem using BS. So it looks like some optimization is required...
Look. (+)
Posted by Alexey 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.