# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
691877 |
2023-01-31T20:03:24 Z |
Abito |
Game (APIO22_game) |
C++17 |
|
2 ms |
2640 KB |
#include "game.h"
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
const int N=1e5+5;
int n,k;
bool h=0,vis[N];
vector<int> adj[N];
void dfs(int node){
vis[node]=true;
for (auto u:adj[node]){
if (vis[u]){
h=1;
break;
}
dfs(u);
}
return;
}
void init(int nn, int kk) {
n=nn;k=kk;
for (int i=0;i<k-1;i++) adj[i].pb(i+1);
return;
}
int add_teleporter(int u, int v) {
adj[u].pb(v);
adj[v].pb(u);
if (h) return h;
for (int i=0;i<n;i++) vis[i]=false;
dfs(0);
return h;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2640 KB |
Output is correct |
2 |
Incorrect |
2 ms |
2640 KB |
Wrong Answer[1] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2640 KB |
Output is correct |
2 |
Incorrect |
2 ms |
2640 KB |
Wrong Answer[1] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2640 KB |
Output is correct |
2 |
Incorrect |
2 ms |
2640 KB |
Wrong Answer[1] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2640 KB |
Output is correct |
2 |
Incorrect |
2 ms |
2640 KB |
Wrong Answer[1] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2640 KB |
Output is correct |
2 |
Incorrect |
2 ms |
2640 KB |
Wrong Answer[1] |
3 |
Halted |
0 ms |
0 KB |
- |