Submission #582525

#TimeUsernameProblemLanguageResultExecution timeMemory
582525MurotY게임 (APIO22_game)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define ll long long #include "game.h" using namespace std; const int N=1e6+7; vector <ll> g[N]; ll used[N]; void init(int n, int k) { for (int i=0;i<k-1;i++){ g[i].push_back(i+1); } } int add_teleporter(int u, int v) { if (u == v && u < k) return 1; g[u].push_back(v); bool ok=0; fill(used, used+10000, 0); function <void(ll,ll)> dfs = [&] (ll v, ll p){ used[v]=1; for (auto l:g[v]){ if (used[l] == 0) dfs(l, v); else if (used[l] == 1 && l != p){ ok=1; return ; } } used[v]=2; }; dfs(1, 0); if (ok) return 1; else return 0; }

Compilation message (stderr)

game.cpp: In function 'int add_teleporter(int, int)':
game.cpp:15:23: error: 'k' was not declared in this scope
   15 |     if (u == v && u < k) return 1;
      |                       ^