Submission #712890

#TimeUsernameProblemLanguageResultExecution timeMemory
712890irmuun게임 (APIO22_game)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "game.h" using namespace std; #define pb push_back #define ll long long #define ff first #define ss second #define PI 3.1415926535897932384626433 #define all(s) s.begin(),s.end() vector<ll>dv[30005]; ll df[30005]; ll cur=0; bool dfs(ll u){ if(df[u]==2) return true; if(df[u]==1) return i>=k; df[u]=1; for(auto x:dv[u]){ if(dfs(x)==false){ return false; } } df[u]=2; return true; } void init(int N,int K){ n=N; k=K; for(int i=0;i<=k-2;i++){ dv[i].pb(i+1); } } int add_teleporter(int u,int v){ dv[u].pb(v); for(ll i=0;i<n;i++) df[i]=0; bool ok=dfs(0); if(ok==false){ return 1; } else{ return 0; } }

Compilation message (stderr)

game.cpp: In function 'bool dfs(long long int)':
game.cpp:15:25: error: 'i' was not declared in this scope
   15 |     if(df[u]==1) return i>=k;
      |                         ^
game.cpp:15:28: error: 'k' was not declared in this scope
   15 |     if(df[u]==1) return i>=k;
      |                            ^
game.cpp: In function 'void init(int, int)':
game.cpp:27:5: error: 'n' was not declared in this scope
   27 |     n=N;
      |     ^
game.cpp:28:5: error: 'k' was not declared in this scope
   28 |     k=K;
      |     ^
game.cpp: In function 'int add_teleporter(int, int)':
game.cpp:35:18: error: 'n' was not declared in this scope
   35 |     for(ll i=0;i<n;i++) df[i]=0;
      |                  ^