Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- const int N=1e6+10;
- int a[N];
- int main()
- {
- int n;
- scanf("%d",&n);
- for(int i=1;i<=n;++i){
- int x,y;
- scanf("%d%d",&x,&y);
- a[x]++; a[y]--;
- }
- int ans=0;
- for(int i=0;i<=1000000;++i){
- a[i]+=a[i-1];
- ans=max(ans,a[i]);
- }
- printf("%d",ans);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement