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

Re:数据超弱,这样也过...

Posted by 00948162 at 2010-10-18 12:01:04 on Problem 1716
In Reply To:数据超弱,这样也过... Posted by:yuanyirui at 2007-04-19 13:38:17
我觉得这个代码有问题啊
看这组数据
4
1 3
3 5
4 5
5 8
输出
4
可是画个图
0 1 2 3 4 5 6 7 8
  - - -
      - - -
        - -
          - - - -
头尾两个interval至少要用4个数字,第三个interval至少还要1个数据,所以要5个数据啊
错误在于这句 只有一个在里面的状况
            else if(inv[i].be<=el[1] && el[1]<=inv[i].en){//只有一个
                el[0]=el[1];
                el[1]=inv[i].en;
                ans++;
            }
应先判断el[1]是不是和inv[i].end相等,因为如果相等,这句的结果就是el[0] == el[1] == inv[i].end 但是按理el[0]和el[1]不应该是相等的
可是可是这个代码居然AC了!
改过的代码居然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