# |
제출 시각 |
아이디 |
문제 |
언어 |
결과 |
실행 시간 |
메모리 |
746850 |
2023-05-23T07:15:13 Z |
tutis |
게임 (APIO22_game) |
C++17 |
|
4000 ms |
27320 KB |
#pragma GCC optimize("O3")
#pragma GCC target("avx2")
#include <bits/stdc++.h>
using namespace std;
const int N = 300000;
int K;
vector<int>adj_[N];
int mn[N];
void init(int n, int k) {
K = k;
for (int i = 0; i < n; i++)
mn[i] = k;
}
int add_teleporter(int u, int v) {
int x = min(v, mn[v]);
int ret = 0;
function<void(int)>dfs = [&](int i) {
mn[i] = x;
if (i < K && x <= i) {
ret = 1;
}
for (int j : adj_[i])
if (mn[j] > x)
dfs(j);
};
if (mn[u] > x)
dfs(u);
adj_[v].push_back(u);
return ret;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
7248 KB |
Output is correct |
2 |
Correct |
4 ms |
7248 KB |
Output is correct |
3 |
Correct |
5 ms |
7248 KB |
Output is correct |
4 |
Correct |
4 ms |
7248 KB |
Output is correct |
5 |
Correct |
4 ms |
7248 KB |
Output is correct |
6 |
Correct |
5 ms |
7348 KB |
Output is correct |
7 |
Correct |
4 ms |
7248 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
7248 KB |
Output is correct |
2 |
Correct |
4 ms |
7248 KB |
Output is correct |
3 |
Correct |
5 ms |
7248 KB |
Output is correct |
4 |
Correct |
4 ms |
7248 KB |
Output is correct |
5 |
Correct |
4 ms |
7248 KB |
Output is correct |
6 |
Correct |
5 ms |
7348 KB |
Output is correct |
7 |
Correct |
4 ms |
7248 KB |
Output is correct |
8 |
Correct |
4 ms |
7248 KB |
Output is correct |
9 |
Correct |
4 ms |
7228 KB |
Output is correct |
10 |
Correct |
4 ms |
7244 KB |
Output is correct |
11 |
Correct |
4 ms |
7248 KB |
Output is correct |
12 |
Correct |
5 ms |
7248 KB |
Output is correct |
13 |
Correct |
4 ms |
7248 KB |
Output is correct |
14 |
Correct |
4 ms |
7248 KB |
Output is correct |
15 |
Correct |
4 ms |
7348 KB |
Output is correct |
16 |
Correct |
5 ms |
7248 KB |
Output is correct |
17 |
Correct |
4 ms |
7248 KB |
Output is correct |
18 |
Correct |
4 ms |
7248 KB |
Output is correct |
19 |
Correct |
4 ms |
7248 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
7248 KB |
Output is correct |
2 |
Correct |
4 ms |
7248 KB |
Output is correct |
3 |
Correct |
5 ms |
7248 KB |
Output is correct |
4 |
Correct |
4 ms |
7248 KB |
Output is correct |
5 |
Correct |
4 ms |
7248 KB |
Output is correct |
6 |
Correct |
5 ms |
7348 KB |
Output is correct |
7 |
Correct |
4 ms |
7248 KB |
Output is correct |
8 |
Correct |
4 ms |
7248 KB |
Output is correct |
9 |
Correct |
4 ms |
7228 KB |
Output is correct |
10 |
Correct |
4 ms |
7244 KB |
Output is correct |
11 |
Correct |
4 ms |
7248 KB |
Output is correct |
12 |
Correct |
5 ms |
7248 KB |
Output is correct |
13 |
Correct |
4 ms |
7248 KB |
Output is correct |
14 |
Correct |
4 ms |
7248 KB |
Output is correct |
15 |
Correct |
4 ms |
7348 KB |
Output is correct |
16 |
Correct |
5 ms |
7248 KB |
Output is correct |
17 |
Correct |
4 ms |
7248 KB |
Output is correct |
18 |
Correct |
4 ms |
7248 KB |
Output is correct |
19 |
Correct |
4 ms |
7248 KB |
Output is correct |
20 |
Correct |
4 ms |
7248 KB |
Output is correct |
21 |
Correct |
4 ms |
7248 KB |
Output is correct |
22 |
Correct |
4 ms |
7380 KB |
Output is correct |
23 |
Correct |
5 ms |
7504 KB |
Output is correct |
24 |
Correct |
6 ms |
7376 KB |
Output is correct |
25 |
Correct |
7 ms |
7376 KB |
Output is correct |
26 |
Correct |
7 ms |
7376 KB |
Output is correct |
27 |
Correct |
6 ms |
7376 KB |
Output is correct |
28 |
Correct |
5 ms |
7376 KB |
Output is correct |
29 |
Correct |
6 ms |
7376 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
7248 KB |
Output is correct |
2 |
Correct |
4 ms |
7248 KB |
Output is correct |
3 |
Correct |
5 ms |
7248 KB |
Output is correct |
4 |
Correct |
4 ms |
7248 KB |
Output is correct |
5 |
Correct |
4 ms |
7248 KB |
Output is correct |
6 |
Correct |
5 ms |
7348 KB |
Output is correct |
7 |
Correct |
4 ms |
7248 KB |
Output is correct |
8 |
Correct |
4 ms |
7248 KB |
Output is correct |
9 |
Correct |
4 ms |
7228 KB |
Output is correct |
10 |
Correct |
4 ms |
7244 KB |
Output is correct |
11 |
Correct |
4 ms |
7248 KB |
Output is correct |
12 |
Correct |
5 ms |
7248 KB |
Output is correct |
13 |
Correct |
4 ms |
7248 KB |
Output is correct |
14 |
Correct |
4 ms |
7248 KB |
Output is correct |
15 |
Correct |
4 ms |
7348 KB |
Output is correct |
16 |
Correct |
5 ms |
7248 KB |
Output is correct |
17 |
Correct |
4 ms |
7248 KB |
Output is correct |
18 |
Correct |
4 ms |
7248 KB |
Output is correct |
19 |
Correct |
4 ms |
7248 KB |
Output is correct |
20 |
Correct |
4 ms |
7248 KB |
Output is correct |
21 |
Correct |
4 ms |
7248 KB |
Output is correct |
22 |
Correct |
4 ms |
7380 KB |
Output is correct |
23 |
Correct |
5 ms |
7504 KB |
Output is correct |
24 |
Correct |
6 ms |
7376 KB |
Output is correct |
25 |
Correct |
7 ms |
7376 KB |
Output is correct |
26 |
Correct |
7 ms |
7376 KB |
Output is correct |
27 |
Correct |
6 ms |
7376 KB |
Output is correct |
28 |
Correct |
5 ms |
7376 KB |
Output is correct |
29 |
Correct |
6 ms |
7376 KB |
Output is correct |
30 |
Correct |
18 ms |
7988 KB |
Output is correct |
31 |
Correct |
7 ms |
7632 KB |
Output is correct |
32 |
Correct |
17 ms |
9252 KB |
Output is correct |
33 |
Correct |
18 ms |
8412 KB |
Output is correct |
34 |
Correct |
495 ms |
10168 KB |
Output is correct |
35 |
Correct |
200 ms |
9012 KB |
Output is correct |
36 |
Correct |
25 ms |
8352 KB |
Output is correct |
37 |
Correct |
22 ms |
8300 KB |
Output is correct |
38 |
Correct |
28 ms |
8356 KB |
Output is correct |
39 |
Correct |
25 ms |
8412 KB |
Output is correct |
40 |
Correct |
415 ms |
10024 KB |
Output is correct |
41 |
Correct |
94 ms |
8708 KB |
Output is correct |
42 |
Correct |
63 ms |
8508 KB |
Output is correct |
43 |
Correct |
33 ms |
10160 KB |
Output is correct |
44 |
Correct |
445 ms |
10184 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
7248 KB |
Output is correct |
2 |
Correct |
4 ms |
7248 KB |
Output is correct |
3 |
Correct |
5 ms |
7248 KB |
Output is correct |
4 |
Correct |
4 ms |
7248 KB |
Output is correct |
5 |
Correct |
4 ms |
7248 KB |
Output is correct |
6 |
Correct |
5 ms |
7348 KB |
Output is correct |
7 |
Correct |
4 ms |
7248 KB |
Output is correct |
8 |
Correct |
4 ms |
7248 KB |
Output is correct |
9 |
Correct |
4 ms |
7228 KB |
Output is correct |
10 |
Correct |
4 ms |
7244 KB |
Output is correct |
11 |
Correct |
4 ms |
7248 KB |
Output is correct |
12 |
Correct |
5 ms |
7248 KB |
Output is correct |
13 |
Correct |
4 ms |
7248 KB |
Output is correct |
14 |
Correct |
4 ms |
7248 KB |
Output is correct |
15 |
Correct |
4 ms |
7348 KB |
Output is correct |
16 |
Correct |
5 ms |
7248 KB |
Output is correct |
17 |
Correct |
4 ms |
7248 KB |
Output is correct |
18 |
Correct |
4 ms |
7248 KB |
Output is correct |
19 |
Correct |
4 ms |
7248 KB |
Output is correct |
20 |
Correct |
4 ms |
7248 KB |
Output is correct |
21 |
Correct |
4 ms |
7248 KB |
Output is correct |
22 |
Correct |
4 ms |
7380 KB |
Output is correct |
23 |
Correct |
5 ms |
7504 KB |
Output is correct |
24 |
Correct |
6 ms |
7376 KB |
Output is correct |
25 |
Correct |
7 ms |
7376 KB |
Output is correct |
26 |
Correct |
7 ms |
7376 KB |
Output is correct |
27 |
Correct |
6 ms |
7376 KB |
Output is correct |
28 |
Correct |
5 ms |
7376 KB |
Output is correct |
29 |
Correct |
6 ms |
7376 KB |
Output is correct |
30 |
Correct |
18 ms |
7988 KB |
Output is correct |
31 |
Correct |
7 ms |
7632 KB |
Output is correct |
32 |
Correct |
17 ms |
9252 KB |
Output is correct |
33 |
Correct |
18 ms |
8412 KB |
Output is correct |
34 |
Correct |
495 ms |
10168 KB |
Output is correct |
35 |
Correct |
200 ms |
9012 KB |
Output is correct |
36 |
Correct |
25 ms |
8352 KB |
Output is correct |
37 |
Correct |
22 ms |
8300 KB |
Output is correct |
38 |
Correct |
28 ms |
8356 KB |
Output is correct |
39 |
Correct |
25 ms |
8412 KB |
Output is correct |
40 |
Correct |
415 ms |
10024 KB |
Output is correct |
41 |
Correct |
94 ms |
8708 KB |
Output is correct |
42 |
Correct |
63 ms |
8508 KB |
Output is correct |
43 |
Correct |
33 ms |
10160 KB |
Output is correct |
44 |
Correct |
445 ms |
10184 KB |
Output is correct |
45 |
Correct |
148 ms |
14128 KB |
Output is correct |
46 |
Correct |
9 ms |
8716 KB |
Output is correct |
47 |
Correct |
7 ms |
8648 KB |
Output is correct |
48 |
Correct |
191 ms |
27320 KB |
Output is correct |
49 |
Correct |
158 ms |
17852 KB |
Output is correct |
50 |
Execution timed out |
4034 ms |
22584 KB |
Time limit exceeded |
51 |
Halted |
0 ms |
0 KB |
- |