# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
572650 |
2022-06-04T22:40:05 Z |
Plurm |
Game (APIO22_game) |
C++17 |
|
1 ms |
452 KB |
#include "game.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> g[1024];
int n, k;
void init(int n, int k) {
::n = n;
::k = k;
}
int color[1024];
bool dfs(int i) {
if (color[i] == 2)
return true;
if (color[i] == 1)
return false;
color[i] = 1;
for (int j : g[i]) {
if (!dfs(j))
return false;
}
color[i] = 2;
return true;
}
int add_teleporter(int u, int v) {
memset(color, 0, sizeof(color));
g[u].push_back(v);
bool ok = true;
for (int i = 0; i < k; i++) {
ok &= dfs(i);
}
return ok ? 0 : 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Output is correct |
2 |
Correct |
0 ms |
208 KB |
Output is correct |
3 |
Correct |
1 ms |
208 KB |
Output is correct |
4 |
Incorrect |
0 ms |
452 KB |
Wrong Answer[1] |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Output is correct |
2 |
Correct |
0 ms |
208 KB |
Output is correct |
3 |
Correct |
1 ms |
208 KB |
Output is correct |
4 |
Incorrect |
0 ms |
452 KB |
Wrong Answer[1] |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Output is correct |
2 |
Correct |
0 ms |
208 KB |
Output is correct |
3 |
Correct |
1 ms |
208 KB |
Output is correct |
4 |
Incorrect |
0 ms |
452 KB |
Wrong Answer[1] |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Output is correct |
2 |
Correct |
0 ms |
208 KB |
Output is correct |
3 |
Correct |
1 ms |
208 KB |
Output is correct |
4 |
Incorrect |
0 ms |
452 KB |
Wrong Answer[1] |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Output is correct |
2 |
Correct |
0 ms |
208 KB |
Output is correct |
3 |
Correct |
1 ms |
208 KB |
Output is correct |
4 |
Incorrect |
0 ms |
452 KB |
Wrong Answer[1] |
5 |
Halted |
0 ms |
0 KB |
- |