제출 #858069

#제출 시각아이디문제언어결과실행 시간메모리
858069rajpragurBest Place (NOI17_bestplace)C++14
100 / 100
69 ms3360 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; vector<int> x; vector<int> y; for(int i = 0 ; i < n ; i++){ int a,b; cin>>a>>b; x.push_back(a); y.push_back(b); } sort(x.begin(),x.end()); sort(y.begin(),y.end()); if(n%2!=0){ cout << x[(n-1)/2] << " " << y[(n-1)/2]; }else{ int ansx,ansy; int a = x[(n/2) - 1], b = x[(n/2)] , c = y[(n/2) - 1] , d = y[(n/2)]; if (b-a <= 1) { ansx = a; }else{ ansx = a + 1; } if (d-c <= 1) { ansy = c; }else{ ansy = c + 1; } cout<< ansx<< " "<<ansy; } 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...