| ||||||||||
| 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 | |||||||||
自己看吧,暴力0M过没什么坑,直接来
#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator