Submission #400641

# Submission time Handle Problem Language Result Execution time Memory
400641 2021-05-08T12:45:50 Z ioi Traffic (IOI10_traffic) C++14
Compilation error
0 ms 0 KB
#include "traffic.h"
#include<bits/stdc++.h>
using namespace std ;

int LocateCentre(int N, int pp[], int S[], int D[]) {
    int mx = 1e9 + 9 ;
    mx = 0 ;
    for(int i = 0 ; i < N ; i ++)
        mn = max(mn , pp[i]);

    for(int i = 0 ; i < N ; i ++)
        if(mn == pp[i])return i ;
   return N/2;
}

Compilation message

traffic.cpp: In function 'int LocateCentre(int, int*, int*, int*)':
traffic.cpp:9:9: error: 'mn' was not declared in this scope; did you mean 'mx'?
    9 |         mn = max(mn , pp[i]);
      |         ^~
      |         mx
traffic.cpp:12:12: error: 'mn' was not declared in this scope; did you mean 'mx'?
   12 |         if(mn == pp[i])return i ;
      |            ^~
      |            mx