| ||||||||||
Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
据说这个O(n^3),居然过了,516msvector<int>top; for(int i=1; i<=n; i++) { scanf("%lf%lf%lf%lf",&l[i].a.x,&l[i].a.y,&l[i].b.x,&l[i].b.y); int siz=top.size(); for(int j=0; j<siz; j++) { int id=top[j]; if(inter(l[i].a,l[i].b,l[id].a,l[id].b)) { top.erase(top.begin()+j); siz--; j--; } } top.push_back(i); } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator