代码:
- #include <iostream>
- #include <algorithm>
- using namespace std;
- int f[201];
-
- int main()
- {
-
- int t, n, i, j, s, e;
- cin >> t;
- while( t-- ){
- memset( f, 0, sizeof(f) );
- cin >> n;
- for( i=0; i<n; i++ ){
- cin >> s >> e;
- s = (s+1)/2;
- e = (e+1)/2;
- if( s > e ){
- int temp = s;
- s = e;
- e = temp;
- }
- for( j=s; j<=e; j++)
- f[j]++;
- }
- int consume = 0;
- for( i=1; i<=200; i++ )
- consume = max( consume, f[i] );
- cout << consume*10 << endl;
- }
-
- return 0;
- }
每个走道被占用几次,说明需要等待几次,所以走道中被占用的最大次数为需要等待的最大时间
hdoj 1050 moving tables,布布扣,bubuko.com
hdoj 1050 moving tables
原文:http://www.cnblogs.com/weiyikang/p/3866077.html