Submission #467460

#TimeUsernameProblemLanguageResultExecution timeMemory
467460Ghost_in_the_WireBest Place (NOI17_bestplace)C++17
100 / 100
45 ms3728 KiB
#include <bits/stdc++.h> #define FIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) using namespace std; typedef long long INT; typedef vector<INT> ARR; int main() { FIO; INT n; cin >> n; ARR x = {}; ARR y = {}; for (int i = 0; i < n; i++) { INT temp1, temp2; cin >> temp1 >> temp2; x.push_back(temp1); y.push_back(temp2); } sort(x.begin(), x.end()); sort(y.begin(), y.end()); INT ansx; INT ansy; if (n%2 == 0) { ansx = x[n/2]; ansy = y[n/2]; } else { ansx = x[(n-1)/2]; ansy = y[(n-1)/2]; } cout << ansx << " " << ansy << "\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...