Submission #314755

#TimeUsernameProblemLanguageResultExecution timeMemory
314755wind_reaperTraffic (IOI10_traffic)C++17
Compilation error
0 ms0 KiB
#include "traffic.h" #include <bits/stdc++.h> using namespace std; vector<vector<int>> edges; int LocateCentre(int n, int p[], int s[], int d[]){ edges.resize(n); vector<int> pref(n); pref[0] = p[0]; for(int i = 1; i < n; i++) pref[i] = pref[i-1] + p[i]; vector<int> suf(n); suf[n-1] = p[n-1]; for(int i = n-2; i >= 0; --i) suf[i] = suf[i+1] + p[i]; int centre = 0; int cur_min = INF; for(int i = 0; i < n; i++){ if(max(pref[i] - p[i], suf[i] - p[i]) < cur_min){ centre = i; cur_min = max(pref[i] - p[i], suf[i] - p[i]); } } return centre; }

Compilation message (stderr)

traffic.cpp: In function 'int LocateCentre(int, int*, int*, int*)':
traffic.cpp:25:16: error: 'INF' was not declared in this scope
   25 |  int cur_min = INF;
      |                ^~~