답안 #962904

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
962904 2024-04-14T09:33:59 Z 0npata 게임 (APIO22_game) C++17
60 / 100
433 ms 3320 KB
#include "game.h"
#include<bits/stdc++.h>
using namespace std;

const int N = 30'005;
const int K = 1'005;

#define pb push_back
#define vec vector

vec<int> nk(N, -1);
//vec<set<pair<int, int>>> g(N);
vec<vec<int>> g(N);
int k;
int n;

void init(int in, int ik) {
	n = in;
	k = ik;

	for(int i = 0; i<k; i++) {
		nk[i] = i;
	}
}

int add_teleporter(int u, int v) {


	g[u].pb(v);;

	vec<int> stack{u};

	while(stack.size() > 0) {
		int cur = stack.back();
		stack.pop_back();

//		cerr << "CUR: " << cur << '\n';

		for(int nxt : g[cur]) {
			int l = nxt;

			//cerr << "l: " << l << ' ' << '\n';

			if(l<k) {
				//cerr << "HERE NO?" << '\n';
				// special node
				if(nk[cur] >= l) {
					return 1;
				}
			}

			if(nk[l] < nk[cur]) {
				stack.pb(l);
				nk[l] = nk[cur];
				//upd.pb(nxt);
			}
			//else if(nk[l] != nxt.first) {
				//upd.pb(nxt);
			//}

			//if(nxt.first >= nk[cur]) break;
		}

		//for(auto val : upd) {
			//g[cur].erase(val);
			//g[cur].insert({nk[val.second], val.second});
		//}
	}

	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1112 KB Output is correct
2 Correct 1 ms 1112 KB Output is correct
3 Correct 1 ms 1112 KB Output is correct
4 Correct 1 ms 1112 KB Output is correct
5 Correct 1 ms 1364 KB Output is correct
6 Correct 1 ms 1112 KB Output is correct
7 Correct 1 ms 1112 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1112 KB Output is correct
2 Correct 1 ms 1112 KB Output is correct
3 Correct 1 ms 1112 KB Output is correct
4 Correct 1 ms 1112 KB Output is correct
5 Correct 1 ms 1364 KB Output is correct
6 Correct 1 ms 1112 KB Output is correct
7 Correct 1 ms 1112 KB Output is correct
8 Correct 1 ms 1112 KB Output is correct
9 Correct 1 ms 1112 KB Output is correct
10 Correct 1 ms 1112 KB Output is correct
11 Correct 1 ms 1112 KB Output is correct
12 Correct 1 ms 1112 KB Output is correct
13 Correct 1 ms 1112 KB Output is correct
14 Correct 1 ms 1112 KB Output is correct
15 Correct 1 ms 1112 KB Output is correct
16 Correct 1 ms 1112 KB Output is correct
17 Correct 1 ms 1108 KB Output is correct
18 Correct 1 ms 1112 KB Output is correct
19 Correct 1 ms 1112 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1112 KB Output is correct
2 Correct 1 ms 1112 KB Output is correct
3 Correct 1 ms 1112 KB Output is correct
4 Correct 1 ms 1112 KB Output is correct
5 Correct 1 ms 1364 KB Output is correct
6 Correct 1 ms 1112 KB Output is correct
7 Correct 1 ms 1112 KB Output is correct
8 Correct 1 ms 1112 KB Output is correct
9 Correct 1 ms 1112 KB Output is correct
10 Correct 1 ms 1112 KB Output is correct
11 Correct 1 ms 1112 KB Output is correct
12 Correct 1 ms 1112 KB Output is correct
13 Correct 1 ms 1112 KB Output is correct
14 Correct 1 ms 1112 KB Output is correct
15 Correct 1 ms 1112 KB Output is correct
16 Correct 1 ms 1112 KB Output is correct
17 Correct 1 ms 1108 KB Output is correct
18 Correct 1 ms 1112 KB Output is correct
19 Correct 1 ms 1112 KB Output is correct
20 Correct 1 ms 1112 KB Output is correct
21 Correct 1 ms 1112 KB Output is correct
22 Correct 1 ms 1112 KB Output is correct
23 Correct 1 ms 1112 KB Output is correct
24 Correct 2 ms 1368 KB Output is correct
25 Correct 2 ms 1112 KB Output is correct
26 Correct 2 ms 1112 KB Output is correct
27 Correct 2 ms 1112 KB Output is correct
28 Correct 2 ms 1112 KB Output is correct
29 Correct 2 ms 1112 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1112 KB Output is correct
2 Correct 1 ms 1112 KB Output is correct
3 Correct 1 ms 1112 KB Output is correct
4 Correct 1 ms 1112 KB Output is correct
5 Correct 1 ms 1364 KB Output is correct
6 Correct 1 ms 1112 KB Output is correct
7 Correct 1 ms 1112 KB Output is correct
8 Correct 1 ms 1112 KB Output is correct
9 Correct 1 ms 1112 KB Output is correct
10 Correct 1 ms 1112 KB Output is correct
11 Correct 1 ms 1112 KB Output is correct
12 Correct 1 ms 1112 KB Output is correct
13 Correct 1 ms 1112 KB Output is correct
14 Correct 1 ms 1112 KB Output is correct
15 Correct 1 ms 1112 KB Output is correct
16 Correct 1 ms 1112 KB Output is correct
17 Correct 1 ms 1108 KB Output is correct
18 Correct 1 ms 1112 KB Output is correct
19 Correct 1 ms 1112 KB Output is correct
20 Correct 1 ms 1112 KB Output is correct
21 Correct 1 ms 1112 KB Output is correct
22 Correct 1 ms 1112 KB Output is correct
23 Correct 1 ms 1112 KB Output is correct
24 Correct 2 ms 1368 KB Output is correct
25 Correct 2 ms 1112 KB Output is correct
26 Correct 2 ms 1112 KB Output is correct
27 Correct 2 ms 1112 KB Output is correct
28 Correct 2 ms 1112 KB Output is correct
29 Correct 2 ms 1112 KB Output is correct
30 Correct 12 ms 2644 KB Output is correct
31 Correct 3 ms 1368 KB Output is correct
32 Correct 14 ms 2904 KB Output is correct
33 Correct 17 ms 2152 KB Output is correct
34 Correct 433 ms 2388 KB Output is correct
35 Correct 161 ms 2480 KB Output is correct
36 Correct 21 ms 2136 KB Output is correct
37 Correct 22 ms 2616 KB Output is correct
38 Correct 22 ms 2544 KB Output is correct
39 Correct 22 ms 2568 KB Output is correct
40 Correct 364 ms 2640 KB Output is correct
41 Correct 79 ms 2556 KB Output is correct
42 Correct 52 ms 2208 KB Output is correct
43 Correct 29 ms 3320 KB Output is correct
44 Correct 242 ms 2780 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1112 KB Output is correct
2 Correct 1 ms 1112 KB Output is correct
3 Correct 1 ms 1112 KB Output is correct
4 Correct 1 ms 1112 KB Output is correct
5 Correct 1 ms 1364 KB Output is correct
6 Correct 1 ms 1112 KB Output is correct
7 Correct 1 ms 1112 KB Output is correct
8 Correct 1 ms 1112 KB Output is correct
9 Correct 1 ms 1112 KB Output is correct
10 Correct 1 ms 1112 KB Output is correct
11 Correct 1 ms 1112 KB Output is correct
12 Correct 1 ms 1112 KB Output is correct
13 Correct 1 ms 1112 KB Output is correct
14 Correct 1 ms 1112 KB Output is correct
15 Correct 1 ms 1112 KB Output is correct
16 Correct 1 ms 1112 KB Output is correct
17 Correct 1 ms 1108 KB Output is correct
18 Correct 1 ms 1112 KB Output is correct
19 Correct 1 ms 1112 KB Output is correct
20 Correct 1 ms 1112 KB Output is correct
21 Correct 1 ms 1112 KB Output is correct
22 Correct 1 ms 1112 KB Output is correct
23 Correct 1 ms 1112 KB Output is correct
24 Correct 2 ms 1368 KB Output is correct
25 Correct 2 ms 1112 KB Output is correct
26 Correct 2 ms 1112 KB Output is correct
27 Correct 2 ms 1112 KB Output is correct
28 Correct 2 ms 1112 KB Output is correct
29 Correct 2 ms 1112 KB Output is correct
30 Correct 12 ms 2644 KB Output is correct
31 Correct 3 ms 1368 KB Output is correct
32 Correct 14 ms 2904 KB Output is correct
33 Correct 17 ms 2152 KB Output is correct
34 Correct 433 ms 2388 KB Output is correct
35 Correct 161 ms 2480 KB Output is correct
36 Correct 21 ms 2136 KB Output is correct
37 Correct 22 ms 2616 KB Output is correct
38 Correct 22 ms 2544 KB Output is correct
39 Correct 22 ms 2568 KB Output is correct
40 Correct 364 ms 2640 KB Output is correct
41 Correct 79 ms 2556 KB Output is correct
42 Correct 52 ms 2208 KB Output is correct
43 Correct 29 ms 3320 KB Output is correct
44 Correct 242 ms 2780 KB Output is correct
45 Runtime error 2 ms 2136 KB Execution killed with signal 11
46 Halted 0 ms 0 KB -