Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdio>
- #include <vector>
- using namespace std;
- int main()
- {
- int N;
- cin >> N;
- vector <int> a(86401,0);
- int h1, m1, s1, h2, m2, s2;
- int input_in, input_out;
- for (int i = 0; i < N; i++) {
- scanf("%d:%d:%d %d:%d:%d", &h1, &m1, &s1, &h2, &m2, &s2);
- input_in = 3600*h1 + 60*m1 + s1;
- input_out = 3600*h2 + 60*m2 + s2;
- a[input_in] += 1;
- a[input_out + 1] -= 1;
- }
- int max = 0;
- int tmp = 0;
- for (int i = 0; i < 86400; i++) {
- tmp += a[i];
- if (tmp > max) {
- max = tmp;
- }
- }
- cout << max;
- }
Advertisement
Add Comment
Please, Sign In to add comment