|
|
back to boardShow all messages Hide all messages[code deleted] Edited by moderator 10.08.2006 10:07 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. Any hints ? Edited by author 09.08.2006 21:48 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. :) Edited by author 10.08.2006 10:09 |
|
|