#include "game.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define INF 1e18
#define ss second
#define ff first
int n,m,l,r,i,j,k,ii,jj,x,y;
bitset<30001> visited[1001];
vector<int> v[30001];
bool shit;
void init(int N, int K) {
n=N;
k=K;
for(i=0;i<k;i++) visited[i].set(i);
}
int add_teleporter(int u, int p){
v[u].pb(p);
for(i=0;i<k;i++){
if(visited[i][u]){
queue<int> q;
q.push(p);
for (; !q.empty(); ) {
const int x = q.front();
q.pop();
if (x <= i) {
return 1;
}
if (!visited[i][x]) {
visited[i].set(x);
for (const int y : v[x]) {
q.push(y);
}
}
}
}
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
976 KB |
Output is correct |
2 |
Correct |
1 ms |
976 KB |
Output is correct |
3 |
Correct |
1 ms |
1360 KB |
Output is correct |
4 |
Correct |
1 ms |
1172 KB |
Output is correct |
5 |
Correct |
1 ms |
1360 KB |
Output is correct |
6 |
Correct |
1 ms |
1360 KB |
Output is correct |
7 |
Correct |
1 ms |
1360 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
976 KB |
Output is correct |
2 |
Correct |
1 ms |
976 KB |
Output is correct |
3 |
Correct |
1 ms |
1360 KB |
Output is correct |
4 |
Correct |
1 ms |
1172 KB |
Output is correct |
5 |
Correct |
1 ms |
1360 KB |
Output is correct |
6 |
Correct |
1 ms |
1360 KB |
Output is correct |
7 |
Correct |
1 ms |
1360 KB |
Output is correct |
8 |
Correct |
1 ms |
976 KB |
Output is correct |
9 |
Correct |
1 ms |
976 KB |
Output is correct |
10 |
Correct |
1 ms |
976 KB |
Output is correct |
11 |
Correct |
1 ms |
976 KB |
Output is correct |
12 |
Correct |
1 ms |
976 KB |
Output is correct |
13 |
Correct |
1 ms |
976 KB |
Output is correct |
14 |
Correct |
1 ms |
1104 KB |
Output is correct |
15 |
Correct |
1 ms |
976 KB |
Output is correct |
16 |
Correct |
1 ms |
976 KB |
Output is correct |
17 |
Correct |
1 ms |
1104 KB |
Output is correct |
18 |
Correct |
1 ms |
1104 KB |
Output is correct |
19 |
Correct |
1 ms |
1104 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
976 KB |
Output is correct |
2 |
Correct |
1 ms |
976 KB |
Output is correct |
3 |
Correct |
1 ms |
1360 KB |
Output is correct |
4 |
Correct |
1 ms |
1172 KB |
Output is correct |
5 |
Correct |
1 ms |
1360 KB |
Output is correct |
6 |
Correct |
1 ms |
1360 KB |
Output is correct |
7 |
Correct |
1 ms |
1360 KB |
Output is correct |
8 |
Correct |
1 ms |
976 KB |
Output is correct |
9 |
Correct |
1 ms |
976 KB |
Output is correct |
10 |
Correct |
1 ms |
976 KB |
Output is correct |
11 |
Correct |
1 ms |
976 KB |
Output is correct |
12 |
Correct |
1 ms |
976 KB |
Output is correct |
13 |
Correct |
1 ms |
976 KB |
Output is correct |
14 |
Correct |
1 ms |
1104 KB |
Output is correct |
15 |
Correct |
1 ms |
976 KB |
Output is correct |
16 |
Correct |
1 ms |
976 KB |
Output is correct |
17 |
Correct |
1 ms |
1104 KB |
Output is correct |
18 |
Correct |
1 ms |
1104 KB |
Output is correct |
19 |
Correct |
1 ms |
1104 KB |
Output is correct |
20 |
Correct |
1 ms |
976 KB |
Output is correct |
21 |
Correct |
1 ms |
1360 KB |
Output is correct |
22 |
Correct |
2 ms |
1360 KB |
Output is correct |
23 |
Correct |
2 ms |
976 KB |
Output is correct |
24 |
Correct |
7 ms |
2768 KB |
Output is correct |
25 |
Correct |
8 ms |
1940 KB |
Output is correct |
26 |
Correct |
7 ms |
1360 KB |
Output is correct |
27 |
Correct |
13 ms |
2872 KB |
Output is correct |
28 |
Correct |
7 ms |
2776 KB |
Output is correct |
29 |
Correct |
11 ms |
2796 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
976 KB |
Output is correct |
2 |
Correct |
1 ms |
976 KB |
Output is correct |
3 |
Correct |
1 ms |
1360 KB |
Output is correct |
4 |
Correct |
1 ms |
1172 KB |
Output is correct |
5 |
Correct |
1 ms |
1360 KB |
Output is correct |
6 |
Correct |
1 ms |
1360 KB |
Output is correct |
7 |
Correct |
1 ms |
1360 KB |
Output is correct |
8 |
Correct |
1 ms |
976 KB |
Output is correct |
9 |
Correct |
1 ms |
976 KB |
Output is correct |
10 |
Correct |
1 ms |
976 KB |
Output is correct |
11 |
Correct |
1 ms |
976 KB |
Output is correct |
12 |
Correct |
1 ms |
976 KB |
Output is correct |
13 |
Correct |
1 ms |
976 KB |
Output is correct |
14 |
Correct |
1 ms |
1104 KB |
Output is correct |
15 |
Correct |
1 ms |
976 KB |
Output is correct |
16 |
Correct |
1 ms |
976 KB |
Output is correct |
17 |
Correct |
1 ms |
1104 KB |
Output is correct |
18 |
Correct |
1 ms |
1104 KB |
Output is correct |
19 |
Correct |
1 ms |
1104 KB |
Output is correct |
20 |
Correct |
1 ms |
976 KB |
Output is correct |
21 |
Correct |
1 ms |
1360 KB |
Output is correct |
22 |
Correct |
2 ms |
1360 KB |
Output is correct |
23 |
Correct |
2 ms |
976 KB |
Output is correct |
24 |
Correct |
7 ms |
2768 KB |
Output is correct |
25 |
Correct |
8 ms |
1940 KB |
Output is correct |
26 |
Correct |
7 ms |
1360 KB |
Output is correct |
27 |
Correct |
13 ms |
2872 KB |
Output is correct |
28 |
Correct |
7 ms |
2776 KB |
Output is correct |
29 |
Correct |
11 ms |
2796 KB |
Output is correct |
30 |
Correct |
20 ms |
1872 KB |
Output is correct |
31 |
Correct |
30 ms |
4748 KB |
Output is correct |
32 |
Correct |
28 ms |
2256 KB |
Output is correct |
33 |
Correct |
15 ms |
1948 KB |
Output is correct |
34 |
Correct |
559 ms |
5628 KB |
Output is correct |
35 |
Correct |
538 ms |
5644 KB |
Output is correct |
36 |
Correct |
80 ms |
2248 KB |
Output is correct |
37 |
Correct |
387 ms |
5724 KB |
Output is correct |
38 |
Correct |
369 ms |
5428 KB |
Output is correct |
39 |
Correct |
482 ms |
5352 KB |
Output is correct |
40 |
Correct |
567 ms |
5640 KB |
Output is correct |
41 |
Correct |
343 ms |
5480 KB |
Output is correct |
42 |
Correct |
267 ms |
5536 KB |
Output is correct |
43 |
Correct |
715 ms |
5572 KB |
Output is correct |
44 |
Correct |
351 ms |
5632 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
976 KB |
Output is correct |
2 |
Correct |
1 ms |
976 KB |
Output is correct |
3 |
Correct |
1 ms |
1360 KB |
Output is correct |
4 |
Correct |
1 ms |
1172 KB |
Output is correct |
5 |
Correct |
1 ms |
1360 KB |
Output is correct |
6 |
Correct |
1 ms |
1360 KB |
Output is correct |
7 |
Correct |
1 ms |
1360 KB |
Output is correct |
8 |
Correct |
1 ms |
976 KB |
Output is correct |
9 |
Correct |
1 ms |
976 KB |
Output is correct |
10 |
Correct |
1 ms |
976 KB |
Output is correct |
11 |
Correct |
1 ms |
976 KB |
Output is correct |
12 |
Correct |
1 ms |
976 KB |
Output is correct |
13 |
Correct |
1 ms |
976 KB |
Output is correct |
14 |
Correct |
1 ms |
1104 KB |
Output is correct |
15 |
Correct |
1 ms |
976 KB |
Output is correct |
16 |
Correct |
1 ms |
976 KB |
Output is correct |
17 |
Correct |
1 ms |
1104 KB |
Output is correct |
18 |
Correct |
1 ms |
1104 KB |
Output is correct |
19 |
Correct |
1 ms |
1104 KB |
Output is correct |
20 |
Correct |
1 ms |
976 KB |
Output is correct |
21 |
Correct |
1 ms |
1360 KB |
Output is correct |
22 |
Correct |
2 ms |
1360 KB |
Output is correct |
23 |
Correct |
2 ms |
976 KB |
Output is correct |
24 |
Correct |
7 ms |
2768 KB |
Output is correct |
25 |
Correct |
8 ms |
1940 KB |
Output is correct |
26 |
Correct |
7 ms |
1360 KB |
Output is correct |
27 |
Correct |
13 ms |
2872 KB |
Output is correct |
28 |
Correct |
7 ms |
2776 KB |
Output is correct |
29 |
Correct |
11 ms |
2796 KB |
Output is correct |
30 |
Correct |
20 ms |
1872 KB |
Output is correct |
31 |
Correct |
30 ms |
4748 KB |
Output is correct |
32 |
Correct |
28 ms |
2256 KB |
Output is correct |
33 |
Correct |
15 ms |
1948 KB |
Output is correct |
34 |
Correct |
559 ms |
5628 KB |
Output is correct |
35 |
Correct |
538 ms |
5644 KB |
Output is correct |
36 |
Correct |
80 ms |
2248 KB |
Output is correct |
37 |
Correct |
387 ms |
5724 KB |
Output is correct |
38 |
Correct |
369 ms |
5428 KB |
Output is correct |
39 |
Correct |
482 ms |
5352 KB |
Output is correct |
40 |
Correct |
567 ms |
5640 KB |
Output is correct |
41 |
Correct |
343 ms |
5480 KB |
Output is correct |
42 |
Correct |
267 ms |
5536 KB |
Output is correct |
43 |
Correct |
715 ms |
5572 KB |
Output is correct |
44 |
Correct |
351 ms |
5632 KB |
Output is correct |
45 |
Runtime error |
3 ms |
2508 KB |
Execution killed with signal 11 |
46 |
Halted |
0 ms |
0 KB |
- |