답안 #972753

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
972753 2024-05-01T05:56:12 Z tamir1 게임 (APIO22_game) C++17
60 / 100
555 ms 6448 KB
#include "game.h"
#include <bits/stdc++.h>
using namespace std;
int N,K;
bitset<30005> vis[1001];
vector<int> v[30005];
void init(int n, int k) {
	N=n;
	K=k;
	for(int i=0;i<k-1;i++){
		v[i].push_back(i+1);
		vis[i][i]=1;
	}
	vis[k-1][k-1]=1;
}
queue<int> q;
int add_teleporter(int x, int y) {
	v[x].push_back(y);
	for(int i=K-1;i>=0;i--){
		if(!vis[i][x]) continue;
		q.push(x);
		vis[i][x]=1;
		while(!q.empty()){
			int a=q.front();
			q.pop();
			for(int j:v[a]){
				if(j<=i) return 1;
				if(!vis[i][j]){
					vis[i][j]=1;
					q.push(j);
				}
			}
		}
	}
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Correct 1 ms 2648 KB Output is correct
3 Correct 1 ms 2648 KB Output is correct
4 Correct 1 ms 2648 KB Output is correct
5 Correct 1 ms 2648 KB Output is correct
6 Correct 1 ms 2648 KB Output is correct
7 Correct 1 ms 2648 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Correct 1 ms 2648 KB Output is correct
3 Correct 1 ms 2648 KB Output is correct
4 Correct 1 ms 2648 KB Output is correct
5 Correct 1 ms 2648 KB Output is correct
6 Correct 1 ms 2648 KB Output is correct
7 Correct 1 ms 2648 KB Output is correct
8 Correct 1 ms 2900 KB Output is correct
9 Correct 1 ms 2648 KB Output is correct
10 Correct 1 ms 2648 KB Output is correct
11 Correct 1 ms 2648 KB Output is correct
12 Correct 1 ms 2648 KB Output is correct
13 Correct 1 ms 2648 KB Output is correct
14 Correct 1 ms 2648 KB Output is correct
15 Correct 1 ms 2648 KB Output is correct
16 Correct 1 ms 2648 KB Output is correct
17 Correct 1 ms 2648 KB Output is correct
18 Correct 1 ms 2648 KB Output is correct
19 Correct 1 ms 2648 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Correct 1 ms 2648 KB Output is correct
3 Correct 1 ms 2648 KB Output is correct
4 Correct 1 ms 2648 KB Output is correct
5 Correct 1 ms 2648 KB Output is correct
6 Correct 1 ms 2648 KB Output is correct
7 Correct 1 ms 2648 KB Output is correct
8 Correct 1 ms 2900 KB Output is correct
9 Correct 1 ms 2648 KB Output is correct
10 Correct 1 ms 2648 KB Output is correct
11 Correct 1 ms 2648 KB Output is correct
12 Correct 1 ms 2648 KB Output is correct
13 Correct 1 ms 2648 KB Output is correct
14 Correct 1 ms 2648 KB Output is correct
15 Correct 1 ms 2648 KB Output is correct
16 Correct 1 ms 2648 KB Output is correct
17 Correct 1 ms 2648 KB Output is correct
18 Correct 1 ms 2648 KB Output is correct
19 Correct 1 ms 2648 KB Output is correct
20 Correct 1 ms 2648 KB Output is correct
21 Correct 1 ms 2648 KB Output is correct
22 Correct 2 ms 2648 KB Output is correct
23 Correct 1 ms 2648 KB Output is correct
24 Correct 8 ms 4696 KB Output is correct
25 Correct 7 ms 3160 KB Output is correct
26 Correct 5 ms 3204 KB Output is correct
27 Correct 17 ms 5720 KB Output is correct
28 Correct 4 ms 4952 KB Output is correct
29 Correct 10 ms 5208 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Correct 1 ms 2648 KB Output is correct
3 Correct 1 ms 2648 KB Output is correct
4 Correct 1 ms 2648 KB Output is correct
5 Correct 1 ms 2648 KB Output is correct
6 Correct 1 ms 2648 KB Output is correct
7 Correct 1 ms 2648 KB Output is correct
8 Correct 1 ms 2900 KB Output is correct
9 Correct 1 ms 2648 KB Output is correct
10 Correct 1 ms 2648 KB Output is correct
11 Correct 1 ms 2648 KB Output is correct
12 Correct 1 ms 2648 KB Output is correct
13 Correct 1 ms 2648 KB Output is correct
14 Correct 1 ms 2648 KB Output is correct
15 Correct 1 ms 2648 KB Output is correct
16 Correct 1 ms 2648 KB Output is correct
17 Correct 1 ms 2648 KB Output is correct
18 Correct 1 ms 2648 KB Output is correct
19 Correct 1 ms 2648 KB Output is correct
20 Correct 1 ms 2648 KB Output is correct
21 Correct 1 ms 2648 KB Output is correct
22 Correct 2 ms 2648 KB Output is correct
23 Correct 1 ms 2648 KB Output is correct
24 Correct 8 ms 4696 KB Output is correct
25 Correct 7 ms 3160 KB Output is correct
26 Correct 5 ms 3204 KB Output is correct
27 Correct 17 ms 5720 KB Output is correct
28 Correct 4 ms 4952 KB Output is correct
29 Correct 10 ms 5208 KB Output is correct
30 Correct 14 ms 3784 KB Output is correct
31 Correct 16 ms 5388 KB Output is correct
32 Correct 16 ms 3932 KB Output is correct
33 Correct 11 ms 3736 KB Output is correct
34 Correct 508 ms 5920 KB Output is correct
35 Correct 450 ms 6208 KB Output is correct
36 Correct 47 ms 3900 KB Output is correct
37 Correct 278 ms 5688 KB Output is correct
38 Correct 368 ms 6104 KB Output is correct
39 Correct 391 ms 6076 KB Output is correct
40 Correct 555 ms 6328 KB Output is correct
41 Correct 311 ms 5844 KB Output is correct
42 Correct 337 ms 6044 KB Output is correct
43 Correct 386 ms 6448 KB Output is correct
44 Correct 257 ms 6244 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Correct 1 ms 2648 KB Output is correct
3 Correct 1 ms 2648 KB Output is correct
4 Correct 1 ms 2648 KB Output is correct
5 Correct 1 ms 2648 KB Output is correct
6 Correct 1 ms 2648 KB Output is correct
7 Correct 1 ms 2648 KB Output is correct
8 Correct 1 ms 2900 KB Output is correct
9 Correct 1 ms 2648 KB Output is correct
10 Correct 1 ms 2648 KB Output is correct
11 Correct 1 ms 2648 KB Output is correct
12 Correct 1 ms 2648 KB Output is correct
13 Correct 1 ms 2648 KB Output is correct
14 Correct 1 ms 2648 KB Output is correct
15 Correct 1 ms 2648 KB Output is correct
16 Correct 1 ms 2648 KB Output is correct
17 Correct 1 ms 2648 KB Output is correct
18 Correct 1 ms 2648 KB Output is correct
19 Correct 1 ms 2648 KB Output is correct
20 Correct 1 ms 2648 KB Output is correct
21 Correct 1 ms 2648 KB Output is correct
22 Correct 2 ms 2648 KB Output is correct
23 Correct 1 ms 2648 KB Output is correct
24 Correct 8 ms 4696 KB Output is correct
25 Correct 7 ms 3160 KB Output is correct
26 Correct 5 ms 3204 KB Output is correct
27 Correct 17 ms 5720 KB Output is correct
28 Correct 4 ms 4952 KB Output is correct
29 Correct 10 ms 5208 KB Output is correct
30 Correct 14 ms 3784 KB Output is correct
31 Correct 16 ms 5388 KB Output is correct
32 Correct 16 ms 3932 KB Output is correct
33 Correct 11 ms 3736 KB Output is correct
34 Correct 508 ms 5920 KB Output is correct
35 Correct 450 ms 6208 KB Output is correct
36 Correct 47 ms 3900 KB Output is correct
37 Correct 278 ms 5688 KB Output is correct
38 Correct 368 ms 6104 KB Output is correct
39 Correct 391 ms 6076 KB Output is correct
40 Correct 555 ms 6328 KB Output is correct
41 Correct 311 ms 5844 KB Output is correct
42 Correct 337 ms 6044 KB Output is correct
43 Correct 386 ms 6448 KB Output is correct
44 Correct 257 ms 6244 KB Output is correct
45 Runtime error 3 ms 4944 KB Execution killed with signal 11
46 Halted 0 ms 0 KB -