-
-
Save Eyakub/afecaa95465fc20f50599babf17c7ccf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
5 | |
8 11 | |
9 11 | |
10 12 | |
11 14 | |
12 14 | |
*/ | |
#include<iostream> | |
#include<cstring> | |
#include<string> | |
#include<stack> | |
#include<queue> | |
#include<vector> | |
#include<set> | |
#include<map> | |
#include<algorithm> | |
#include<cstdio> | |
#include<cstdlib> | |
#include<cmath> | |
#define PI 2*acos(0.0) | |
#define SIZE 1000000 | |
#define endl '\n' | |
int caseno=1; | |
#define CP() printf("Case %d: ",caseno++) | |
#define R() freopen("in.txt","r",stdin) | |
#define W() freopen("out.txt","w",stdout) | |
#define sfi(_i) scanf("%d",&_i) | |
#define sfc(_c) scanf("%c",&_c) | |
#define pf1(_i) cout<<_i | |
#define pfl() cout<<endl | |
#define pfs() printf(" ") | |
#define FOR(i,a,b) for(i=(a);i<(b);i++) | |
#define REV(i,a,b) for(i=(a);i>=(b);i--) | |
using namespace std; | |
int main() { | |
int T[100]; | |
fill(T, T+100,0); | |
int st,ed,i,mn=1000,mx=-1000,n; | |
sfi(n); | |
while(n--) { | |
sfi(st); sfi(ed); | |
if(st<mn) mn=st; | |
if(ed>mx) mx=ed; | |
T[st]++; T[ed]--; | |
} | |
int sum=0,ms=-1000; | |
FOR(i,mn,mx+1){ | |
//pf1(T[i]); pfs(); | |
//pf1(i); pfl(); | |
sum+=T[i]; | |
if(sum>ms) ms=sum; | |
} | |
pf1(ms); pfl(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment