Submission
Status:
[PP][PP][PP][PP][PP][PP][PP][PP][PP][PP]
Subtask/Task Score:
{10/10}{10/10}{10/10}{10/10}{10/10}{10/10}{10/10}{10/10}{10/10}{10/10}
Score: 100
User: dddrrrr
Problemset: ลอดสะพาน
Language: cpp
Time: 0.003 second
Submitted On: 2026-03-10 10:57:51
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int l ,n;
cin >> l >> n;
vector <pair <int ,int>> vp;
for(int i=0 ;i<n ;i++){
int a ,b;
cin >> a >> b;
vp.emplace_back(a ,1);
vp.emplace_back(b ,-1);
}
sort(vp.begin() ,vp.end());
int mx = -1 ,cnt = 0;
for(int i=0 ;i<vp.size() ;i++){
if(vp[i].second == 1)cnt++;
else cnt--;
mx = max(cnt ,mx);
}
cout << mx;
return 0;
}