Submission #697062

# Submission time Handle Problem Language Result Execution time Memory
697062 2023-02-08T05:11:12 Z noobnessOVERLOADED Best Place (NOI17_bestplace) C++17
0 / 100
75 ms 3208 KB
#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

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 time Memory Grader output
1 Incorrect 0 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 66 ms 2840 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 75 ms 3208 KB Output isn't correct
2 Halted 0 ms 0 KB -