제출 #683620

#제출 시각아이디문제언어결과실행 시간메모리
683620Pranav1056Best Place (NOI17_bestplace)C++17
100 / 100
84 ms2992 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int x[n]; int y[n]; for(int i = 0; i < n; i ++){cin >> x[i]; cin >> y[i];} sort(x, x + n); sort(y, y + n); if(n % 2 == 1){cout << x[int((n + 1)/2) - 1] << " " << y[int((n + 1)/2) -1] << "\n";} else{ int x_avg = x[int(n/2) - 1] + x[int(n/2)]; int y_avg = y[int(n/2) - 1] + y[int(n/2)]; cout << int(x_avg/2) << " " << int(y_avg/2) << "\n"; } }
#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...