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 |
Re:求指教哪里错了!!!In Reply To:求指教哪里错了!!! Posted by:771385494 at 2011-12-13 09:45:02 F1怎么可能小于F2。 > #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