Submission
Status:
[PP-SS][SSSSS][SSSSSSSSSS]
Subtask/Task Score:
{0/20}{0/30}{0/50}
Score: 0
User: Ryuthin94
Problemset: ห้องสมุดเมือง 3M
Language: cpp
Time: 0.003 second
Submitted On: 2026-03-05 22:57:55
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, t = 0;
if (!(cin >> n))
{
return 0;
}
vector<int> books;
for (int i = 0; i < n; i++)
{
long long tx, ty;
cin >> tx >> ty;
for (long long j = tx; j < ty; j++)
{
t += 1;
books.push_back(j);
}
}
if (books.empty())
{
return 0;
}
sort(books.begin(), books.end());
long long pos = books.size() / 2 - 1;
cout << books[pos];
}