Submission #972750

# Submission time Handle Problem Language Result Execution time Memory
972750 2024-05-01T05:29:56 Z tamir1 Game (APIO22_game) C++17
30 / 100
4000 ms 9304 KB
#include "game.h"
#include <bits/stdc++.h>
using namespace std;
bitset<300001> vis;
vector<int> v[300001];
int N,K;
void init(int n, int k) {
	N=n;
	K=k;
	for(int i=0;i<k-1;i++){
		v[i].push_back(i+1);
	}
}
queue<int> q;
int add_teleporter(int x, int y) {
	v[x].push_back(y);
	vis.reset();
	for(int i=K-1;i>=0;i--){
		q.push(i);
		vis[i]=1;
		while(!q.empty()){
			int a=q.front();
			q.pop();
			for(int j:v[a]){
				if(j<=i) return 1;
				if(!vis[j]){
					vis[j]=1;
					q.push(j);
				}
			}
		}
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 7256 KB Output is correct
2 Correct 2 ms 7512 KB Output is correct
3 Correct 2 ms 7512 KB Output is correct
4 Correct 2 ms 7512 KB Output is correct
5 Correct 2 ms 7512 KB Output is correct
6 Correct 2 ms 7512 KB Output is correct
7 Correct 2 ms 7512 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 7256 KB Output is correct
2 Correct 2 ms 7512 KB Output is correct
3 Correct 2 ms 7512 KB Output is correct
4 Correct 2 ms 7512 KB Output is correct
5 Correct 2 ms 7512 KB Output is correct
6 Correct 2 ms 7512 KB Output is correct
7 Correct 2 ms 7512 KB Output is correct
8 Correct 2 ms 7512 KB Output is correct
9 Correct 2 ms 7512 KB Output is correct
10 Correct 2 ms 7512 KB Output is correct
11 Correct 2 ms 7512 KB Output is correct
12 Correct 2 ms 7512 KB Output is correct
13 Correct 2 ms 7512 KB Output is correct
14 Correct 2 ms 7512 KB Output is correct
15 Correct 2 ms 7512 KB Output is correct
16 Correct 2 ms 7512 KB Output is correct
17 Correct 2 ms 7512 KB Output is correct
18 Correct 2 ms 7512 KB Output is correct
19 Correct 3 ms 7512 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 7256 KB Output is correct
2 Correct 2 ms 7512 KB Output is correct
3 Correct 2 ms 7512 KB Output is correct
4 Correct 2 ms 7512 KB Output is correct
5 Correct 2 ms 7512 KB Output is correct
6 Correct 2 ms 7512 KB Output is correct
7 Correct 2 ms 7512 KB Output is correct
8 Correct 2 ms 7512 KB Output is correct
9 Correct 2 ms 7512 KB Output is correct
10 Correct 2 ms 7512 KB Output is correct
11 Correct 2 ms 7512 KB Output is correct
12 Correct 2 ms 7512 KB Output is correct
13 Correct 2 ms 7512 KB Output is correct
14 Correct 2 ms 7512 KB Output is correct
15 Correct 2 ms 7512 KB Output is correct
16 Correct 2 ms 7512 KB Output is correct
17 Correct 2 ms 7512 KB Output is correct
18 Correct 2 ms 7512 KB Output is correct
19 Correct 3 ms 7512 KB Output is correct
20 Correct 3 ms 7512 KB Output is correct
21 Correct 2 ms 7512 KB Output is correct
22 Correct 3 ms 7512 KB Output is correct
23 Correct 2 ms 7512 KB Output is correct
24 Correct 7 ms 7512 KB Output is correct
25 Correct 25 ms 8056 KB Output is correct
26 Correct 30 ms 7760 KB Output is correct
27 Correct 35 ms 8024 KB Output is correct
28 Correct 12 ms 7512 KB Output is correct
29 Correct 25 ms 7768 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 7256 KB Output is correct
2 Correct 2 ms 7512 KB Output is correct
3 Correct 2 ms 7512 KB Output is correct
4 Correct 2 ms 7512 KB Output is correct
5 Correct 2 ms 7512 KB Output is correct
6 Correct 2 ms 7512 KB Output is correct
7 Correct 2 ms 7512 KB Output is correct
8 Correct 2 ms 7512 KB Output is correct
9 Correct 2 ms 7512 KB Output is correct
10 Correct 2 ms 7512 KB Output is correct
11 Correct 2 ms 7512 KB Output is correct
12 Correct 2 ms 7512 KB Output is correct
13 Correct 2 ms 7512 KB Output is correct
14 Correct 2 ms 7512 KB Output is correct
15 Correct 2 ms 7512 KB Output is correct
16 Correct 2 ms 7512 KB Output is correct
17 Correct 2 ms 7512 KB Output is correct
18 Correct 2 ms 7512 KB Output is correct
19 Correct 3 ms 7512 KB Output is correct
20 Correct 3 ms 7512 KB Output is correct
21 Correct 2 ms 7512 KB Output is correct
22 Correct 3 ms 7512 KB Output is correct
23 Correct 2 ms 7512 KB Output is correct
24 Correct 7 ms 7512 KB Output is correct
25 Correct 25 ms 8056 KB Output is correct
26 Correct 30 ms 7760 KB Output is correct
27 Correct 35 ms 8024 KB Output is correct
28 Correct 12 ms 7512 KB Output is correct
29 Correct 25 ms 7768 KB Output is correct
30 Correct 107 ms 8868 KB Output is correct
31 Correct 51 ms 7800 KB Output is correct
32 Correct 50 ms 9164 KB Output is correct
33 Correct 35 ms 9304 KB Output is correct
34 Correct 967 ms 8656 KB Output is correct
35 Execution timed out 4002 ms 8896 KB Time limit exceeded
36 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 7256 KB Output is correct
2 Correct 2 ms 7512 KB Output is correct
3 Correct 2 ms 7512 KB Output is correct
4 Correct 2 ms 7512 KB Output is correct
5 Correct 2 ms 7512 KB Output is correct
6 Correct 2 ms 7512 KB Output is correct
7 Correct 2 ms 7512 KB Output is correct
8 Correct 2 ms 7512 KB Output is correct
9 Correct 2 ms 7512 KB Output is correct
10 Correct 2 ms 7512 KB Output is correct
11 Correct 2 ms 7512 KB Output is correct
12 Correct 2 ms 7512 KB Output is correct
13 Correct 2 ms 7512 KB Output is correct
14 Correct 2 ms 7512 KB Output is correct
15 Correct 2 ms 7512 KB Output is correct
16 Correct 2 ms 7512 KB Output is correct
17 Correct 2 ms 7512 KB Output is correct
18 Correct 2 ms 7512 KB Output is correct
19 Correct 3 ms 7512 KB Output is correct
20 Correct 3 ms 7512 KB Output is correct
21 Correct 2 ms 7512 KB Output is correct
22 Correct 3 ms 7512 KB Output is correct
23 Correct 2 ms 7512 KB Output is correct
24 Correct 7 ms 7512 KB Output is correct
25 Correct 25 ms 8056 KB Output is correct
26 Correct 30 ms 7760 KB Output is correct
27 Correct 35 ms 8024 KB Output is correct
28 Correct 12 ms 7512 KB Output is correct
29 Correct 25 ms 7768 KB Output is correct
30 Correct 107 ms 8868 KB Output is correct
31 Correct 51 ms 7800 KB Output is correct
32 Correct 50 ms 9164 KB Output is correct
33 Correct 35 ms 9304 KB Output is correct
34 Correct 967 ms 8656 KB Output is correct
35 Execution timed out 4002 ms 8896 KB Time limit exceeded
36 Halted 0 ms 0 KB -