| ||||||||||
| 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 | |||||||||
求指教哪里错了!!!#include <iostream>
using namespace std;
int main()
{
long int C,F1,F2,D,array[100][2],i,j;
while(scanf("%ld %ld %ld %ld",&C,&F1,&F2,&D) != EOF){
int map[2000] = {0};
for(i = 0; i < C; i++)
{
cin >> array[i][0] >> array[i][1];
for(j = array[i][0]; j <= array[i][1]; j++)
map[j]++;
}
for(i = D; i >= 0; i--)
{
F1 -= map[i];
if(F1 <= F2)
break;
}
if(i == D)
cout << i << endl;
else if(F1 == F2)
cout << i << endl;
else if(F1 < F2)
cout << i + 1 << endl;
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator