Submission #377689

#TimeUsernameProblemLanguageResultExecution timeMemory
377689Christopher_RdzTraffic (IOI10_traffic)C++17
Compilation error
0 ms0 KiB
#include "traffic.h" #include <bits/stdc++.h> int acumulado[1000002]; int LocateCentre(int N, int pp[], int S[], int D[]) { for (int i = 0; i < N; i++){ if (i == 0){ acumulado[i] = pp[i]; }else{ acumulado[i] = pp[i] + acumulado[i - 1]; } } int res = 0; int maxi = INT_MAX; int aux = 0; int der = 0; int izq = 0; for (int i = 0; i < N; i++){ der = acumulado[N - 1] - acumulado[i]; if (i == 0){ maxi = der; res = i; }else{ izq = acumulado[i - 1]; aux = min(izq, der); if (aux < maxi){ maxi = aux; res = i; } } } return res; }

Compilation message (stderr)

traffic.cpp: In function 'int LocateCentre(int, int*, int*, int*)':
traffic.cpp:26:19: error: 'min' was not declared in this scope; did you mean 'std::min'?
   26 |             aux = min(izq, der);
      |                   ^~~
      |                   std::min
In file included from /usr/include/c++/9/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
                 from traffic.cpp:2:
/usr/include/c++/9/bits/stl_algo.h:3450:5: note: 'std::min' declared here
 3450 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~