# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
710358 |
2023-03-15T07:39:48 Z |
Astrayt |
Game (APIO22_game) |
C++17 |
|
9 ms |
14312 KB |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define maxn 300005
int N, K, low[maxn];
vector<int> adj[maxn], rev[maxn];
void init(int n, int k){
N = n, K = k;
for(int i = 0; i < k - 1; ++i) adj[i].pb(i + 1), rev[i + 1].pb(i);
for(int i = 0; i < n; ++i) low[i] = i;
}
int add_teleporter(int u, int v){
if(u == v){
if(u < K) return 1;
else return 0;
}
adj[u].pb(v);
rev[v].pb(u);
queue<int> bfs; bfs.push(v);
while(bfs.size()){
int a = bfs.front(); bfs.pop();
for(auto b:rev[a]){
if(b <= low[a] && b < K) return 1;
if(low[b] > low[a]) {
low[b] = low[a];
bfs.push(b);
}
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
14288 KB |
Output is correct |
2 |
Incorrect |
8 ms |
14312 KB |
Wrong Answer[1] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
14288 KB |
Output is correct |
2 |
Incorrect |
8 ms |
14312 KB |
Wrong Answer[1] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
14288 KB |
Output is correct |
2 |
Incorrect |
8 ms |
14312 KB |
Wrong Answer[1] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
14288 KB |
Output is correct |
2 |
Incorrect |
8 ms |
14312 KB |
Wrong Answer[1] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
14288 KB |
Output is correct |
2 |
Incorrect |
8 ms |
14312 KB |
Wrong Answer[1] |
3 |
Halted |
0 ms |
0 KB |
- |