Submission #1200253

#TimeUsernameProblemLanguageResultExecution timeMemory
1200253timasdfadsfadsfRace (IOI11_race)C++20
Compilation error
0 ms0 KiB
process(v, u, depth + 1, sum + w, filling, c); } } } void build(int u, int p) { int n = dfs(u, p); int c = dfs(u, p, c); par[c] = p; rem[c] = true; mp[0] = {0, c}; for (auto [v, w] : tree[c]) { if (!rem[v]) { process(v, c, 1, w, 0, c); process(v, c, 1, w, 1, c); } } for (auto [v, w] : tree[c]) { if (!rem[v]) { build(v, u); } } } public: CD(const vector<vector<pair<int, long long>>>& t, int k_) { int n = t.size(); sub.resize(n); rem.resize(n); par.resize(n); tree = t; k = k_; build(0, -1); } int solve() { return ans; } }; struct edge { int u, v, w; }; int best_path(int n, int k, int h[][2], int* l) { vector<edge> E(n - 1); for (int i = 0; i < n - 1; i++) { int u = h[i][0], v = h[i][1]; E[i] = {u, v, -1}; } for (int i = 0; i < n - 1; i++) { int ll = l[i]; E[i].w = ll; } vector<vector<pair<int, long long>>> t(n); for (auto e : E) { t[e.u].push_back({e.v, e.w}); t[e.v].push_back({e.u, e.w}); } CD g(t, k); return g.solve(); }

Compilation message (stderr)

race.cpp:1:24: error: expected constructor, destructor, or type conversion before '(' token
    1 |                 process(v, u, depth + 1, sum + w, filling, c);
      |                        ^
race.cpp:2:13: error: expected declaration before '}' token
    2 |             }
      |             ^
race.cpp:3:9: error: expected declaration before '}' token
    3 |         }
      |         ^
race.cpp:4:5: error: expected declaration before '}' token
    4 |     }
      |     ^
race.cpp: In function 'void build(int, int)':
race.cpp:7:17: error: 'dfs' was not declared in this scope
    7 |         int n = dfs(u, p);
      |                 ^~~
race.cpp:9:9: error: 'par' was not declared in this scope
    9 |         par[c] = p;
      |         ^~~
race.cpp:10:9: error: 'rem' was not declared in this scope
   10 |         rem[c] = true;
      |         ^~~
race.cpp:11:9: error: 'mp' was not declared in this scope; did you mean 'p'?
   11 |         mp[0] = {0, c};
      |         ^~
      |         p
race.cpp:12:28: error: 'tree' was not declared in this scope
   12 |         for (auto [v, w] : tree[c]) {
      |                            ^~~~
race.cpp:14:17: error: 'process' was not declared in this scope
   14 |                 process(v, c, 1, w, 0, c);
      |                 ^~~~~~~
race.cpp:18:28: error: 'tree' was not declared in this scope
   18 |         for (auto [v, w] : tree[c]) {
      |                            ^~~~
race.cpp: At global scope:
race.cpp:24:1: error: expected unqualified-id before 'public'
   24 | public:
      | ^~~~~~
race.cpp: In function 'int solve()':
race.cpp:35:16: error: 'ans' was not declared in this scope
   35 |         return ans;
      |                ^~~
race.cpp: At global scope:
race.cpp:37:1: error: expected declaration before '}' token
   37 | };
      | ^
race.cpp: In function 'int best_path(int, int, int (*)[2], int*)':
race.cpp:44:5: error: 'vector' was not declared in this scope
   44 |     vector<edge> E(n - 1);
      |     ^~~~~~
race.cpp:44:16: error: expected primary-expression before '>' token
   44 |     vector<edge> E(n - 1);
      |                ^
race.cpp:44:18: error: 'E' was not declared in this scope
   44 |     vector<edge> E(n - 1);
      |                  ^
race.cpp:53:19: error: 'pair' was not declared in this scope
   53 |     vector<vector<pair<int, long long>>> t(n);
      |                   ^~~~
race.cpp:53:24: error: expected primary-expression before 'int'
   53 |     vector<vector<pair<int, long long>>> t(n);
      |                        ^~~
race.cpp:55:9: error: 't' was not declared in this scope
   55 |         t[e.u].push_back({e.v, e.w});
      |         ^
race.cpp:58:5: error: 'CD' was not declared in this scope
   58 |     CD g(t, k);
      |     ^~
race.cpp:59:12: error: 'g' was not declared in this scope
   59 |     return g.solve();
      |            ^