# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
740473 |
2023-05-12T14:11:28 Z |
Kenjikrab |
Game (APIO22_game) |
C++17 |
|
4000 ms |
8656 KB |
#include "game.h"
#include<bits/stdc++.h>
using namespace std;
int const n_max=3e5+10;
int N,K;
bitset<n_max> visited;
vector<int> len(n_max,INT_MAX);
vector<int> node[n_max];
void init(int n, int k)
{
cin.tie(nullptr)->sync_with_stdio(false);
N=n;
K=k;
for(int i=0;i<k;i++)
{
visited[i]=true;
len[i]=i;
}
}
int add_teleporter(int u, int v)
{
if(visited[u])
{
if(v<K&&len[u]>=v)return 1;
queue<int> q;
if(!visited[v]||len[v]<len[u])q.push(v);
visited[v]=true;
while(!q.empty())
{
int cur=q.front();
len[cur]=len[u];
q.pop();
for(auto nxt:node[cur])
{
if(nxt<K&&len[cur]>=nxt)return 1;
if(!visited[nxt]||len[nxt]<len[cur])
{
q.push(nxt);
}
}
}
}
else node[u].push_back(v);
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
8528 KB |
Output is correct |
2 |
Correct |
5 ms |
8656 KB |
Output is correct |
3 |
Correct |
5 ms |
8528 KB |
Output is correct |
4 |
Correct |
5 ms |
8528 KB |
Output is correct |
5 |
Correct |
5 ms |
8528 KB |
Output is correct |
6 |
Correct |
5 ms |
8528 KB |
Output is correct |
7 |
Correct |
4 ms |
8528 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
8528 KB |
Output is correct |
2 |
Correct |
5 ms |
8656 KB |
Output is correct |
3 |
Correct |
5 ms |
8528 KB |
Output is correct |
4 |
Correct |
5 ms |
8528 KB |
Output is correct |
5 |
Correct |
5 ms |
8528 KB |
Output is correct |
6 |
Correct |
5 ms |
8528 KB |
Output is correct |
7 |
Correct |
4 ms |
8528 KB |
Output is correct |
8 |
Correct |
4 ms |
8528 KB |
Output is correct |
9 |
Correct |
5 ms |
8528 KB |
Output is correct |
10 |
Correct |
5 ms |
8528 KB |
Output is correct |
11 |
Execution timed out |
4053 ms |
8528 KB |
Time limit exceeded |
12 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
8528 KB |
Output is correct |
2 |
Correct |
5 ms |
8656 KB |
Output is correct |
3 |
Correct |
5 ms |
8528 KB |
Output is correct |
4 |
Correct |
5 ms |
8528 KB |
Output is correct |
5 |
Correct |
5 ms |
8528 KB |
Output is correct |
6 |
Correct |
5 ms |
8528 KB |
Output is correct |
7 |
Correct |
4 ms |
8528 KB |
Output is correct |
8 |
Correct |
4 ms |
8528 KB |
Output is correct |
9 |
Correct |
5 ms |
8528 KB |
Output is correct |
10 |
Correct |
5 ms |
8528 KB |
Output is correct |
11 |
Execution timed out |
4053 ms |
8528 KB |
Time limit exceeded |
12 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
8528 KB |
Output is correct |
2 |
Correct |
5 ms |
8656 KB |
Output is correct |
3 |
Correct |
5 ms |
8528 KB |
Output is correct |
4 |
Correct |
5 ms |
8528 KB |
Output is correct |
5 |
Correct |
5 ms |
8528 KB |
Output is correct |
6 |
Correct |
5 ms |
8528 KB |
Output is correct |
7 |
Correct |
4 ms |
8528 KB |
Output is correct |
8 |
Correct |
4 ms |
8528 KB |
Output is correct |
9 |
Correct |
5 ms |
8528 KB |
Output is correct |
10 |
Correct |
5 ms |
8528 KB |
Output is correct |
11 |
Execution timed out |
4053 ms |
8528 KB |
Time limit exceeded |
12 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
8528 KB |
Output is correct |
2 |
Correct |
5 ms |
8656 KB |
Output is correct |
3 |
Correct |
5 ms |
8528 KB |
Output is correct |
4 |
Correct |
5 ms |
8528 KB |
Output is correct |
5 |
Correct |
5 ms |
8528 KB |
Output is correct |
6 |
Correct |
5 ms |
8528 KB |
Output is correct |
7 |
Correct |
4 ms |
8528 KB |
Output is correct |
8 |
Correct |
4 ms |
8528 KB |
Output is correct |
9 |
Correct |
5 ms |
8528 KB |
Output is correct |
10 |
Correct |
5 ms |
8528 KB |
Output is correct |
11 |
Execution timed out |
4053 ms |
8528 KB |
Time limit exceeded |
12 |
Halted |
0 ms |
0 KB |
- |