Submission #499825

#TimeUsernameProblemLanguageResultExecution timeMemory
499825PothePandaBest Place (NOI17_bestplace)C++14
100 / 100
37 ms2656 KiB
#include<bits/stdc++.h> using namespace std; using ll = long long; void solve(){ int n; cin>>n; int x[n]; int y[n]; int x_curr,y_curr; for(int i =0;i<n;i++){ cin>>x[i]>>y[i]; } sort(x,x+n); sort(y,y+n); if(n%2==1){ cout<<x[(n/2)]<<" "<<y[n/2]; } else{ int x_1 = x[(n/2)-1]+x[(n/2)]; int y_1 = y[(n/2)-1]+y[(n/2)]; cout<<x_1/2<<" "<<y_1/2; } } int main(){ ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); int t = 1; //cin>>t; while(t--){ solve(); } }

Compilation message (stderr)

bestplace.cpp: In function 'void solve()':
bestplace.cpp:9:9: warning: unused variable 'x_curr' [-Wunused-variable]
    9 |     int x_curr,y_curr;
      |         ^~~~~~
bestplace.cpp:9:16: warning: unused variable 'y_curr' [-Wunused-variable]
    9 |     int x_curr,y_curr;
      |                ^~~~~~
#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...