Submission #118434

#TimeUsernameProblemLanguageResultExecution timeMemory
118434IOrtroiiiAmusement Park (JOI17_amusement_park)C++14
Compilation error
0 ms0 KiB
#include "Joi.h" #include <bits/stdc++.h> using namespace std; using ll = long long; const int N = 10100; static int tot; static vector<int> g[N]; static vector<int> comp[N]; static int where[N]; static int a[N]; static bool visit[N]; static int reva[60]; void dfs(int u) { where[u] = tot; comp[tot].emplace_back(u); for (int v : g[u]) { if (comp[tot].size() == 60) { return; } else if (!where[v]) { dfs(v); } } } void extra_dfs(int u, int where, int &need) { visit[u] = true; for (int v : g[u]) if (!visit[v]) { if (::where[v] != where) { reva[a[v]] = v; --need; } if (need == 0) return; extra_dfs(v, where, need); } } void Joi(int n, int m, int a[], int b[], ll x, int t) { for (int i = 0; i < m; ++i) { g[a[i]].emplace_back(b[i]); g[b[i]].emplace_back(a[i]); } for (int i = 0; i < n; ++i) if (!where[i]) { ++tot; dfs(i); } for (int i = 1; i <= tot; ++i) { if (comp[i].size() == 60) { int ptr = 0; for (int u : comp[i]) { a[u] = ptr++; } for (int u : comp[i]) { vector<int> ng; for (int v : g[u]) { if (where[v] == where[u]) { ng.emplace_back(v); } } g[u].swap(ng); } } } for (int i = 1; i <= tot; ++i) if (comp[i].size() < 60) { memset(reva, -1, sizeof reva); int need = 60 - comp[i].size(); extra_dfs(comp[i].back(), i, need); int ptr = 0; vector<int> ncomp; for (int j = 0; j < 60; ++j) { if (~reva[j]) { ncomp.emplace_back(reva[j]); } else { a[comp[i][ptr]] = j; ncomp.push_back(comp[i][ptr++]); } } comp[i].swap(ncomp); for (int u : comp[i]) { visit[u] = false; } } for (int i = 0; i < n; ++i) { MessageBoard(i, (x >> a[i]) & 1); } }
#include "Ioi.h" #include <bits/stdc++.h> using namespace std; using ll = long long; const int N = 10100; static int tot; static vector<int> g[N]; static vector<int> comp[N]; static int where[N]; static int a[N]; static bool visit[N]; static int reva[60]; static int can[N]; void dfs(int u) { where[u] = tot; comp[tot].emplace_back(u); for (int v : g[u]) { if (comp[tot].size() == 60) { return; } else if (!where[v]) { dfs(v); } } } void extra_dfs(int u, int where, int &need) { visit[u] = true; for (int v : g[u]) if (!visit[v]) { if (::where[v] != where) { reva[a[v]] = v; --need; } if (need == 0) return; extra_dfs(v, where, need); } } ll ans = 0; void dfs_solve(int u) { visit[u] = true; for (int v : g[u]) { if (can[v] && !visit[v]) { bool t = Move(v); ans |= (1ll << a[v]) * t; solve(v); Move(u); } } } ll Ioi(int n, int m, int a[], int b[], int p, int v, int t) { for (int i = 0; i < m; ++i) { g[a[i]].emplace_back(b[i]); g[b[i]].emplace_back(a[i]); } for (int i = 0; i < n; ++i) if (!where[i]) { ++tot; dfs(i); } for (int i = 1; i <= tot; ++i) { if (comp[i].size() == 60) { int ptr = 0; for (int u : comp[i]) { a[u] = ptr++; } for (int u : comp[i]) { vector<int> ng; for (int v : g[u]) { if (where[v] == where[u]) { ng.emplace_back(v); } } g[u].swap(ng); } } } for (int i = 1; i <= tot; ++i) if (comp[i].size() < 60) { memset(reva, -1, sizeof reva); int need = 60 - comp[i].size(); extra_dfs(comp[i].back(), i, need); int ptr = 0; vector<int> ncomp; for (int j = 0; j < 60; ++j) { if (~reva[j]) { ncomp.emplace_back(reva[j]); } else { a[comp[i][ptr]] = j; ncomp.push_back(comp[i][ptr++]); } } comp[i].swap(ncomp); for (int u : comp[i]) { visit[u] = false; } } for (int v : comp[where[p]]) { can[v] = true; } ans = v * (1ll << a[p]); solve(p); return ans; }

Compilation message (stderr)

Ioi.cpp: In function 'void dfs_solve(int)':
Ioi.cpp:52:10: error: 'solve' was not declared in this scope
          solve(v);
          ^~~~~
Ioi.cpp:52:10: note: suggested alternative: 'Move'
          solve(v);
          ^~~~~
          Move
Ioi.cpp: In function 'll Ioi(int, int, int*, int*, int, int, int)':
Ioi.cpp:106:4: error: 'solve' was not declared in this scope
    solve(p);
    ^~~~~
Ioi.cpp:106:4: note: suggested alternative: 'Move'
    solve(p);
    ^~~~~
    Move