Submission

Status:

[PP-SS][SSSSS][SSSSSSSSSS]

Subtask/Task Score:

{0/20}{0/30}{0/50}

Score: 0

User: FakeAnutin

Problemset: ห้องสมุดเมือง 3M

Language: cpp

Time: 0.004 second

Submitted On: 2026-11-26 19:13:16

#include <bits/stdc++.h>
using namespace std;
int main(){
	ios::sync_with_stdio(false); cin.tie(0);
	vector<int> v;
	int n;
	cin>>n;
	for(int i=1;i<=n;i++){
		int x,y; cin>>x>>y;
		for(int j=x;j<y;j++){
			v.push_back(j);
		}
	}
	int p = v.size() / 2 - 1;  
	nth_element(v.begin(), v.begin() + p, v.end());
	cout << v[p];
}