Submission

Status:
[PPPPP][PPPPP][xSSSSSSSSS]

Score: 50

User: Nightingale

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

Language: cpp

Time: 0.495 second

Submitted On: 2025-03-31 19:01:33

#include <bits/stdc++.h>
#define int long long
using namespace std;
int32_t main() 
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int a;
  cin >> a;
  vector<int> book;
  for(int i=0;i<a;i++){
    int b,c;
    cin >> b >> c;
    for(int j=b;j<c;j++){
      book.push_back(j);
    }
  }
  sort(book.begin(),book.end());
  int large = book.size()/2-1;
  if(large<0) large = 0;
  cout << book[large];
}