Submission
Status:
[PP-SS][SSSSS][SSSSSSSSSS]
Subtask/Task Score:
{0/20}{0/30}{0/50}
Score: 0
User: faofao
Problemset: ห้องสมุดเมือง 3M
Language: cpp
Time: 0.002 second
Submitted On: 2026-03-13 18:16:41
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int n,k=0 ;
vector<int> v ;
int main(){
ios::sync_with_stdio(0),cin.tie(0) ;
cin >> n ;
for(int i=0 ; i<n ; i++){
int x,y ; cin >> x >> y;
for(int j=x ; j<y ; j++){
k++ ;
v.push_back(j) ;
}
}
sort(v.begin(),v.end()) ;
cout << v[(k/2)-1] ;
}