Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- vector<int> v(100000, 0);
- for(int i = 0; i < n; i++) {
- string S, E;
- cin >> S >> E;
- int h = (S[0] - '0') * 10 + (S[1] - '0');
- int m = (S[3] - '0') * 10 + (S[4] - '0');
- int s = (S[6] - '0') * 10 + (S[7] - '0');
- int t = h * 3600 + m * 60 + s;
- v[t]++;
- h = (E[0] - '0') * 10 + (E[1] - '0');
- m = (E[3] - '0') * 10 + (E[4] - '0');
- s = (E[6] - '0') * 10 + (E[7] - '0');
- t = h * 3600 + m * 60 + s;
- v[t + 1]--;
- }
- int sum = 0;
- int res = 0;
- for(int i = 0; i < 100000; i++) {
- sum += v[i];
- res = max(res, sum);
- }
- cout << res << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement