标签:
1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 6 int main() 7 { 8 //freopen("in.txt","r",stdin); 9 int sum[1550]; 10 int t,m,n,i,j,am,ah,lm,lh,ar,le,ans,num; 11 scanf("%d",&t); 12 while(t--) 13 { 14 memset(sum,0,sizeof(sum)); 15 scanf("%d",&n); 16 for(i=0;i<n;i++) 17 { 18 scanf("%d %d:%d %d:%d",&num,&ah,&am,&lh,&lm); 19 int ar=ah*60+am; 20 int le=lh*60+lm-1; 21 for(j=ar;j<=le;j++) 22 sum[j]+=num; 23 } 24 ans=0; 25 for(i=0;i<1550;i++) 26 ans=max(ans,sum[i]); 27 printf("%d\n",ans); 28 } 29 return 0; 30 }
HDU 4883 TIANKENG’s restaurant
标签:
原文地址:http://www.cnblogs.com/homura/p/4694298.html