Submission

Status:
[PP-SS][SSSSS][SSSSSSSSSS]

Score: 0

User: Nightingale

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

Language: cpp

Time: 0.003 second

Submitted On: 2025-03-31 18:46:29

#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;
  map<int,int> book;
  for(int i=0;i<a;i++){
    int b,c;
    cin >> b >> c;
    for(int j=b;j<c;j++){
      book[j] = 1;
    }
  }
  int counter = 0;
  for(auto it=book.begin();it!=book.end();it++){
    counter++;
    if(counter==book.size()/2){
      cout << it->first;
      return 0;
    }
  }
}