Untitled

mail@pastecode.io avatar
unknown
c_cpp
a month ago
497 B
1
Indexable
Never
#include<iostream>
#include <map>
//#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
    vector<int> v(100000, 0);
    for(int i =0 ; i < n; i++) {
        int h, m, d;
        cin >> h >> m >> d;
        int S = h * 60 + m;
        int E = S + d + 1;
        v[S]++;
        v[E + 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;
}
Leave a Comment