제출 #1011473

#제출 시각아이디문제언어결과실행 시간메모리
1011473andecaandeciBest Place (NOI17_bestplace)C++17
3 / 100
1083 ms3108 KiB
//made by djsksbrbf
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;

int main(){
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  
  int n; cin >> n;
  vector <pair<int, int>> v;
  for(int i = 0 ; i < n ; i++){
    int x, y; cin >> x >> y;
    v.push_back({x, y});
  }
  
  pii prev1 = {0, 0}, prev2 = {0, 0};
  while(v.size() > 2){
    prev1 = *v.begin();
    prev2 = v.back();
    
    v.erase(v.begin());
    v.pop_back();
  }
  
  if(v.size() == 1)cout << v[0].first << ' ' << v[0].second << endl;
  else{
    if(prev1 == v[0])cout << v[0].first << ' ' << v[0].second << endl;
    else if(prev2 == v[1])cout << v[1].first << ' ' << v[1].second << endl;
    else cout << (v[0].first + v[1].first) / 2 << ' ' << (v[0].second + v[1].second) / 2 << endl;
  }
  
  return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...