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 |
这样做有什么问题不排序,不设区间。 把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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator