Submission
Status:
[PPTSS][SSSSS][SSSSSSSSSS]
Subtask/Task Score:
{0/20}{0/30}{0/50}
Score: 0
User: Seng
Problemset: ห้องสมุดเมือง 3M
Language: cpp
Time: 1.083 second
Submitted On: 2026-05-26 17:49:11
#include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(0);cin.tie(0);
int n;cin >> n;
priority_queue<int, vector<int>, greater<int>> pq;
while(n--){
int x, y;cin >> x >> y;
for(int i = x; i < y; i++) pq.push(i);
}
// while(!pq.empty()){
// int x = pq.top();
// pq.pop();
// cout << x << " ";
// }
int ss = pq.size()/2-1;
while(ss--){
pq.pop();
}
cout << pq.top();
}