标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)
Total Submission(s): 1536 Accepted Submission(s): 556
1 #include <cmath> 2 #include <cstdio> 3 #include <cstring> 4 #include <algorithm> 5 #include <iostream> 6 using namespace std; 7 int num[1450]; 8 bool cmp(int a, int b) 9 { 10 return a > b; 11 } 12 int main() 13 { 14 int m, t; 15 scanf("%d", &t); 16 while(t--) 17 { 18 memset(num, 0, sizeof(num)); 19 scanf("%d", &m); 20 while(m--) 21 { 22 int a, b, c, d, e, maxx = 0; 23 scanf("%d %d:%d %d:%d", &a, &b, &c, &d, &e); 24 int time1 = b*60 + c; 25 int time2 = d*60 + e; 26 for(int i=time1; i<time2; i++) 27 { 28 // for(i=time1; i<time2; i++) 29 num[i] += a; 30 } 31 } 32 sort(num, num+1440, cmp); 33 printf("%d\n", num[0]); 34 } 35 return 0; 36 }
杭电4883--TIANKENG’s restaurant(区间覆盖)
标签:
原文地址:http://www.cnblogs.com/fengshun/p/4694065.html