Submission #697060

#TimeUsernameProblemLanguageResultExecution timeMemory
697060noobnessOVERLOADEDBest Place (NOI17_bestplace)C++17
Compilation error
0 ms0 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; i <= n-1; i++){ a[j][0] = b[j]; } for(int k = 0; i <= n-1; i++){ 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:15:18: error: 'i' was not declared in this scope
   15 |   for(int j = 0; i <= n-1; i++){
      |                  ^
bestplace.cpp:19:18: error: 'i' was not declared in this scope
   19 |   for(int k = 0; i <= n-1; i++){
      |                  ^
bestplace.cpp:31:7: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   31 |   if(o=1){
      |      ~^~