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 daringQQ at 2006-08-01 23:41:08 on Problem 2906
In Reply To:按wywcgs的方法写的.还WA,好心人帮我看看吧 Posted by:daringQQ at 2006-08-01 21:31:52
> bool ok()
> {
> 	int i, j, day, min, max;
> 	sort(m, m+n);
> 	min = m[0].begin;
> 	max = 0;
> 	for (i = 0; i < n; i++)
> 		if (m[i].end > max) max = m[i].end;
> 	size = 0;
> 	for (day = min, i = 0; day <= max; day++)
> 	{
> 		for (; i < n && m[i].begin == day; i++)
> 			push(m[i].end);
> 		for (j = 0; j < p && size > 0; j++)
> 		{
> 			if (heap[1] < day) return false;
> 			pop();
> 		}
> 	}
> 	return size == 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