Submission
Status:
[PP-SS][SSSSS][SSSSSSSSSS]
Score: 0
User: Nightingale
Problemset: ห้องสมุดเมือง 3M
Language: cpp
Time: 0.003 second
Submitted On: 2025-03-28 11:44:53
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int a;
cin >> a;
vector<int> book;
vector<int> already(300000,0);
for(int i=0;i<a;i++){
int b;
int c;
cin >> b >> c;
for(int j=b;j<c;j++){
if(already[j]==0){
book.push_back(j);
already[j]++;
}
}
}
sort(book.begin(),book.end());
cout << book[book.size()/2-1];
}