笔试题

This commit is contained in:
Estom
2021-09-13 09:55:06 +08:00
parent d395cbcfad
commit 05a6a86266
8 changed files with 173 additions and 17 deletions

View File

@@ -0,0 +1,22 @@
#include<iostream>
#include<map>
using namespace std;
int main(){
int N;
cin>>N;
map<int,int> m;
while(N--){
int x,y;
cin>>x>>y;
m.count(x)?m[x]++:m[x]=1;
m.count(x+y+1)?m[x+y+1]--:m[x+y+1]=-1;
}
int max_num=0;
int num=0;
for(auto v:m){
num+=v.second;
max_num=max(num,max_num);
}
cout<<max_num<<endl;
}