Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- int T_start = 0;
- char* cnt = new char[1000002];
- int T_end = 0;
- for (int i = 0; i < 1000002; i++) {
- cnt[i] = 0;
- }
- int s = 0;
- int max = 0;
- for (int i = 0; i < n; ++i) {
- int l;
- cin >> T_start >> l;
- T_end = T_start + l;
- for (int j = T_start; j < T_end; ++j) {
- cnt[j]++;
- if (cnt[j] > max) {
- max = cnt[j];
- }
- }
- }
- cout << max;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement