Submission
Status:
[PPPP-][SSSSS][SSSSSSSSSS]
Subtask/Task Score:
{0/20}{0/30}{0/50}
Score: 0
User: cyblox_boi
Problemset: ห้องสมุดเมือง 3M
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-24 01:24:36
#include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<int> books;
for (int i = 0; i < n; i++) {
int x, y;
cin >> x >> y;
for (int j = x; j < y; j++) {
books.push_back(j);
}
}
sort(books.begin(), books.end());
cout << books[ceil(books.size() / 2.0) - 1] << '\n';
return 0;
}