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

这样做有什么问题

Posted by xjtudaniel at 2009-10-13 19:14:55 on Problem 1083 and last updated at 2009-10-13 19:17:30
不排序,不设区间。

把n个移动序列进行O(n^2)扫描

for(i=0;i<n;i++)
{ 
    if(visit[i] == 0)
    {
       visit[i] = 1;
       for(j=i+1;j<n;j++)
          if(visit[j] == 0 && judge(a[i][0],a[i][1],a[j][0],a[j][1]) == 1)  //表示不重合
              visit[j] = 1;
       sum++;
    }
}

printf sum*10;

所有测试数据都过,可是就是wa

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