# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
982810 | FZ_Melo | Game (APIO22_game) | C++17 | 0 ms | 344 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "game.h"
#include <bits/stdc++.h>
using namespace std;
int esp;
vector<vector<int>> adj;
bool used[300000];
bool si=0;
void dfs(int node){
if(node<esp && used[node]){
si=1;
return;
}
if(used[node])
return;
used[node]=1;
for(int h: adj[node]){
dfs(h);
}
}
void init(int n, int k) {
adj.resize(n);
esp=k;
for(int i=1; i<esp; i++){
adj[i-1].push_back(i);
}
si=0;
}
int add_teleporter(int u, int v) {
adj[u].push_back(v);
for(int i=0; i<adj.size(); i++)
used[i]=0;
dfs(0);
return si;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |