Submission #949024

#TimeUsernameProblemLanguageResultExecution timeMemory
949024anotherPROgrammerBest Place (NOI17_bestplace)C++14
100 / 100
77 ms3524 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int x =0; int y = 0; vector<int> xi; vector<int> yi; for(int i = 0;i<n;i++){ int a; int b; cin >> a>>b; xi.push_back(a); yi.push_back(b); } sort(xi.begin(),xi.end()); sort(yi.begin(),yi.end()); if (n%2 == 0){ x = round((xi[n/2 - 1] + xi[n/2])/2.0); y = round((yi[n/2 - 1] + yi[n/2])/2.0); } else{ x = xi[n/2]; y = yi[n/2]; } cout << x<<" "<<y<<endl; }
#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...