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++

Show all messages Hide all messages

Help!!! TL12 Stanislav_Ognqnov 9 Aug 2006 21:22
[code deleted]

Edited by moderator 10.08.2006 10:07
Re: Help!!! TL12 Burunduk1 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.
Re: Help!!! TL12 Stanislav_Ognqnov 9 Aug 2006 21:43
Any hints ?

Edited by author 09.08.2006 21:48
Re: Help!!! TL12 Samsonov Alex [USU] 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. :)
Re: Help!!! TL12 Burunduk1 10 Aug 2006 02:00
Shaman :)


Edited by author 10.08.2006 10:09