Submission

Status:

[PP-SS][SSSSS][SSSSSSSSSS]

Subtask/Task Score:

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

Score: 0

User: Seng

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

Language: cpp

Time: 0.002 second

Submitted On: 2026-05-26 18:18:50

#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
int main(){
	ios::sync_with_stdio(0);cin.tie(0);
	int n;cin >> n;
	while(n--){
		long long x, y;cin >> x >> y;
		for(long long i = x; i < y; i++) v.push_back(i);
	}
	long long ss = v.size()/2-1;
//	for(auto e : v) cout << e << " ";
//	cout << '\n';
	sort(v.begin(), v.end());
//	for(auto e : v) cout << e << " ";
//	cout << '\n';
	cout << v[ss];
}