标签:
Time Limit: 5000/2000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)
Total Submission(s): 2522 Accepted Submission(s): 1070
#include <iostream> #include <algorithm> #include <cstdio> #include <cstring> using namespace std; const int N = 2e3 + 5; const int MAX = 5e5 + 5; int hash[N],a[MAX]; int main() { int n; while(~scanf("%d",&n)) { int HH,MM,H,M,sum = 0; sum = 24*60; memset(hash,0,sizeof(hash)); for(int i = 0;i < n;++i){ scanf("%d:%d",&HH,&MM); scanf("%d:%d",&H,&M); HH = HH*60 + MM; //start time H = H*60 + M; // end time for(int i = HH;i < H;++i){ if(!hash[i]){ sum--; hash[i] = 1; } } } printf("%d\n",sum); } return 0; }
标签:
原文地址:http://www.cnblogs.com/a972290869/p/4231282.html