# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
591531 |
2022-07-07T14:39:50 Z |
MDario |
Game (APIO22_game) |
C++17 |
|
4 ms |
7248 KB |
#include "game.h"
#include<bits/stdc++.h>
using namespace std;
int n, k;
bitset<300000> e;
vector<int> ad[300000];
bool r=0;
void dfs(int xf){
e[xf]=1;
for(auto i : ad[xf]){
if(i<k)r=1;
else if(!e[i])dfs(i);
}
return;
}
void init(int N, int K) {
n=N;
k=K;
for(int i=0; i<k; i++)e[i]=1;
return;
}
int add_teleporter(int u, int v) {
if(r)return 1;
if(e[u]){
if(v<k)r=1;
else if(!e[v]){
dfs(v);
}
}
else ad[u].push_back(v);
return r;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
7248 KB |
Output is correct |
2 |
Incorrect |
4 ms |
7248 KB |
Wrong Answer[1] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
7248 KB |
Output is correct |
2 |
Incorrect |
4 ms |
7248 KB |
Wrong Answer[1] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
7248 KB |
Output is correct |
2 |
Incorrect |
4 ms |
7248 KB |
Wrong Answer[1] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
7248 KB |
Output is correct |
2 |
Incorrect |
4 ms |
7248 KB |
Wrong Answer[1] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
7248 KB |
Output is correct |
2 |
Incorrect |
4 ms |
7248 KB |
Wrong Answer[1] |
3 |
Halted |
0 ms |
0 KB |
- |