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

终于AC了。。。。

Posted by hncsyjc at 2013-06-04 12:54:25 on Problem 2481
这题真是坑爹。。。。
注意一下几个方面可能让你的程序WA
(1)、排序后r相同的,要按l再从小到大再排一遍
(2)、输入所有l,r要+1
(3)、l,r相同的不能计算
对应的几组数据:
(1)
IN:
8
9 18
9 19
5 6
4 5
10 15
3 5
5 12
9 14
0
OUT:
1 0 1 1 2 0 0 2
(2)
IN:
8
0 1
0 2
0 3
0 4
0 5
0 6
0 7
0 8
0
OUT:7 6 5 4 3 2 1 0
(3)
IN:
8
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
0
OUT:0 0 0 0 0 0 0 0

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