Submission #697062

#TimeUsernameProblemLanguageResultExecution timeMemory
697062noobnessOVERLOADEDBest Place (NOI17_bestplace)C++17
0 / 100
75 ms3208 KiB
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int a[n][2]; int b[n]; int c[n]; for(int i = 0; i <= n-1; i++){ cin >> a[i][0] >> a[i][1]; } for(int j = 0; j <= n-1; j++){ a[j][0] = b[j]; } for(int k = 0; k <= n-1; k++){ a[k][1] = c[k]; } int m = n/2; int z = 2*m; int o = n-z; sort(b, b+n); sort(c, c+n); if(o=1){ int sum1 = b[m+1]; int sum2 = c[m+1]; cout << sum1 << " " << sum2; } else{ int sum1 = (b[m]+b[m+1])/2; int sum2 = (c[m]+c[m+1])/2; cout << sum1 << " " << sum2; } }

Compilation message (stderr)

bestplace.cpp: In function 'int main()':
bestplace.cpp:31:7: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   31 |   if(o=1){
      |      ~^~
#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...