제출 #393366

#제출 시각아이디문제언어결과실행 시간메모리
393366huukhangTraffic (IOI10_traffic)C++11
컴파일 에러
0 ms0 KiB
// - Only when necessary :d // #pragma GCC optimize("Ofast") // #pragma GCC optimize("unroll-loops") #include "traffic.h" #include <bits/stdc++.h> using namespace std; const ll mod = 1e9 + 7; const ll inf = 2e9; const double eps = 1e-9; int sum = 0; int a[1000005]; vector<vector<int>> g; int sz[1000005], congest[1000005]; void dfs(int s, int p) { for (auto v : g[s]) { if (v != p) { dfs(v, s); sz[s] += sz[v]; congest[s] = max(congest[s], congest[v]); } } congest[s] = max(congest[s], sum - sz[s] - a[s]); sz[s] += a[s]; } int LocateCentre(int n, int p[], int s[], int d[]) { for (int i = 0; i < n; ++i) a[i] = p[i]; g.resize(n); for (int i = 0; i < n - 1; ++i) { g[s[i]].push_back(d[i]); g[d[i]].push_back(s[i]); } for (int i = 0; i < n; ++i) sum += a[i]; dfs(0, -1); int mn = inf, ans; for (int i = 0; i < n; ++i) { if (mn > congest[i]) { mn = congest[i]; ans = i; } } return ans; }

컴파일 시 표준 에러 (stderr) 메시지

traffic.cpp:9:7: error: 'll' does not name a type
    9 | const ll mod = 1e9 + 7;
      |       ^~
traffic.cpp:10:7: error: 'll' does not name a type
   10 | const ll inf = 2e9;
      |       ^~
traffic.cpp: In function 'int LocateCentre(int, int*, int*, int*)':
traffic.cpp:44:11: error: 'inf' was not declared in this scope; did you mean 'ynf'?
   44 |  int mn = inf, ans;
      |           ^~~
      |           ynf
traffic.cpp:48:4: error: 'ans' was not declared in this scope; did you mean 'abs'?
   48 |    ans = i;
      |    ^~~
      |    abs
traffic.cpp:52:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   52 |  return ans;
      |         ^~~
      |         abs