Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <map>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- map<int, int> mapa;
- for(int i = 0; i < n; i++) {
- int S, E;
- cin >> S >> E;
- mapa[S] += 1;
- mapa[E + 1] -= 1;
- }
- int zbir = 0;
- int customers = 0;
- for(auto x : mapa) {
- zbir += x.second;
- if(zbir > customers) {
- customers = zbir;
- }
- }
- cout << customers << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement