| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1305807 | jojeonghoon | Game (APIO22_game) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
#include "game.h"
using namespace std;
int D[LM];
int dfs(int x, int w){
w+=x<K;
if(D[x]) return 1;
D[x]=w;
for(int i:G[x]){
if(dfs(i,w)) return 1;
}
return 0;
}
int add_teleporter(int u, int v){
G[u].push_back(v);
fill(D,D+N,0);
D[u]=1;
return dfs(v,1);
}
