SHARE
TWEET

Untitled

a guest Apr 19th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. const int N=1e6+10;
  5. int a[N];
  6. int main()
  7. {
  8.     int n;
  9.     scanf("%d",&n);
  10.     for(int i=1;i<=n;++i){
  11.         int x,y;
  12.         scanf("%d%d",&x,&y);
  13.         a[x]++; a[y]--;
  14.     }
  15.     int ans=0;
  16.     for(int i=0;i<=1000000;++i){
  17.         a[i]+=a[i-1];
  18.         ans=max(ans,a[i]);
  19.     }
  20.     printf("%d",ans);
  21.     return 0;
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top