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

自己看吧,暴力0M过

Posted by jinhouyu at 2015-04-27 16:51:01 on Problem 2459
没什么坑,直接来
#include<stdio.h>
int cow[103][2010];
int main()
{
	int C,F1,F2,D;
	int i,j,count,first,final;
	while((scanf("%d%d%d%d",&C,&F1,&F2,&D))!=EOF)
	{
		count=0;
		for(i=1;i<=C;i++)
		{
			scanf("%d%d",&first,&final);
			for(j=first;j<=final;j++)
				cow[i][j]=1;	
		}
		for(j=D;;j--)
		{
			for(i=1;i<=C;i++)
				if(cow[i][j]==1)
				count++;
				if(count==F1-F2)
					break; 
		}
		printf("%d\n",j);
	} 
	return 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