Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

据说这个O(n^3),居然过了,516ms

Posted by AK47biubiubiu at 2017-07-07 09:31:09 on Problem 2653
 vector<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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator