# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
740466 |
2023-05-12T13:58:56 Z |
Kenjikrab |
Game (APIO22_game) |
C++17 |
|
4 ms |
7248 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> node[n_max];
void init(int n, int k)
{
N=n;
K=k;
for(int i=0;i<k;i++)
{
visited[i]=true;
}
}
int add_teleporter(int u, int v)
{
if(visited[u])
{
if(v<K)return 1;
queue<int> q;
if(!visited[v])q.push(v);
visited[v]=true;
while(!q.empty())
{
int cur=q.front();
q.pop();
for(auto nxt:node[cur])
{
if(nxt<K)return 1;
if(visited[nxt])continue;
visited[nxt]=true;
q.push(nxt);
}
}
}
else node[u].push_back(v);
return 0;
}
# |
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 |
- |