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 1452. Pascal vs. C++

Stanislav_Ognqnov Help!!! TL12 [5] // Problem 1452. Pascal vs. C++ 9 Aug 2006 21:22
[code deleted]

Edited by moderator 10.08.2006 10:07
Burunduk1 Re: Help!!! TL12 [4] // Problem 1452. Pascal vs. C++ 9 Aug 2006 21:27
for(i=0;i<l-1;i++)
for(j=i+1;j<l;j++)
{
if(Max>l-j)break;
z=b[j].x-b[i].x;
M[0]=b[i].pos;
M[1]=b[j].pos;
l1=2;
xb=b[j].x+z;

for(k=j+1;k<l;k++)
{
if(Max>l-k+l1)break;
bs=BSearch(xb,k);
...

Maybe it is O(N^3*logN)?

PS: Even if it's O(N^2*logN) it won't pass TL, only O(N^2) can do it.
Stanislav_Ognqnov Re: Help!!! TL12 // Problem 1452. Pascal vs. C++ 9 Aug 2006 21:43
Any hints ?

Edited by author 09.08.2006 21:48
Samsonov Alex [USU] Re: Help!!! TL12 [2] // Problem 1452. Pascal vs. C++ 9 Aug 2006 22:32
To Burunduk1: You are wrong. During the contest my O(N^2*logN) solution got accepted (with 0.25 sec). Magic "i++ -> ++i" and "inline" saved me. :)
Burunduk1 Re: Help!!! TL12 [1] // Problem 1452. Pascal vs. C++ 10 Aug 2006 02:00
Shaman :)


Edited by author 10.08.2006 10:09