#include "beechtree.h"
#include<bits/stdc++.h>
using namespace std;
#define vec vector
const int MXN = 200'005;
vec<int> tree[MXN];
map<int, int> tree_col_sz[MXN];
map<int, int> tree_ord[MXN];
vec<int> ans;
int tree_sz[MXN];
void dfs0(int u = 0) {
tree_sz[u] = 1;
for(int v : tree[u]) {
dfs0(v);
tree_sz[u] += tree_sz[v];
}
}
void dfs(int u = 0) {
tree_ord[u].insert({tree_sz[u], u});
if(tree[u].size() == 0) {
return;
}
for(int v : tree[u]) {
dfs(v);
ans[u] &= ans[v];
}
if(ans[u] == 0) return;
sort(tree[u].begin(), tree[u].end(), [&](int v, int w) { return tree_ord[v].size() > tree_ord[w].size(); });
tree[u].push_back(u);
int f = tree[u][0];
for(int i = 1; i<tree[u].size(); i++) {
int v = tree[u][i];
for(auto [w_sz, w] : tree_ord[v]) {
auto it = tree_ord[f].lower_bound(w_sz);
if(it != tree_ord[f].end()) {
int x = it->second;
for(auto [c, c_cnt] : tree_col_sz[w]) {
if(tree_col_sz[x][c] < c_cnt) {
ans[u] = 0;
return;
}
}
}
if(it != tree_ord[f].begin()) {
it--;
int x = it->second;
for(auto [c, c_cnt] : tree_col_sz[x]) {
if(tree_col_sz[w][c] < c_cnt) {
ans[u] = 0;
return;
}
}
}
tree_ord[f].insert({w_sz, w});
}
}
tree_ord[u] = move(tree_ord[f]);
}
std::vector<int> beechtree(int N, int M, std::vector<int> P, std::vector<int> C)
{
ans = vec<int>(N, 1);
for(int i = 1; i<N; i++) {
tree[P[i]].push_back(i);
}
dfs0();
//for(int i = 0; i<N; i++) cerr << tree_sz[i] << ' ';
//cerr << '\n';
for(int i = 1; i<N; i++) {
if(tree_col_sz[P[i]].count(C[i])) {
ans[P[i]] = 0;
}
tree_col_sz[P[i]][C[i]] = tree_sz[i];
}
dfs();
return ans;
}
Compilation message
beechtree.cpp: In function 'void dfs(int)':
beechtree.cpp:39:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
39 | for(int i = 1; i<tree[u].size(); i++) {
| ~^~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
24412 KB |
Output is correct |
2 |
Correct |
3 ms |
24412 KB |
Output is correct |
3 |
Correct |
3 ms |
24412 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
24412 KB |
Output is correct |
2 |
Correct |
4 ms |
24504 KB |
Output is correct |
3 |
Correct |
3 ms |
24508 KB |
Output is correct |
4 |
Correct |
3 ms |
24412 KB |
Output is correct |
5 |
Correct |
4 ms |
24412 KB |
Output is correct |
6 |
Correct |
3 ms |
24412 KB |
Output is correct |
7 |
Correct |
3 ms |
24412 KB |
Output is correct |
8 |
Correct |
3 ms |
24412 KB |
Output is correct |
9 |
Correct |
5 ms |
24540 KB |
Output is correct |
10 |
Correct |
4 ms |
24412 KB |
Output is correct |
11 |
Correct |
3 ms |
24412 KB |
Output is correct |
12 |
Correct |
3 ms |
24412 KB |
Output is correct |
13 |
Correct |
3 ms |
24412 KB |
Output is correct |
14 |
Correct |
3 ms |
24412 KB |
Output is correct |
15 |
Correct |
3 ms |
24408 KB |
Output is correct |
16 |
Correct |
3 ms |
24500 KB |
Output is correct |
17 |
Correct |
5 ms |
24496 KB |
Output is correct |
18 |
Correct |
3 ms |
24412 KB |
Output is correct |
19 |
Correct |
3 ms |
24488 KB |
Output is correct |
20 |
Correct |
4 ms |
24524 KB |
Output is correct |
21 |
Correct |
3 ms |
24412 KB |
Output is correct |
22 |
Correct |
3 ms |
24412 KB |
Output is correct |
23 |
Correct |
3 ms |
24412 KB |
Output is correct |
24 |
Correct |
3 ms |
24412 KB |
Output is correct |
25 |
Correct |
3 ms |
24412 KB |
Output is correct |
26 |
Correct |
3 ms |
24412 KB |
Output is correct |
27 |
Correct |
4 ms |
24412 KB |
Output is correct |
28 |
Correct |
3 ms |
24532 KB |
Output is correct |
29 |
Correct |
3 ms |
24512 KB |
Output is correct |
30 |
Correct |
3 ms |
24516 KB |
Output is correct |
31 |
Correct |
3 ms |
24412 KB |
Output is correct |
32 |
Correct |
3 ms |
24412 KB |
Output is correct |
33 |
Correct |
3 ms |
24412 KB |
Output is correct |
34 |
Correct |
3 ms |
24412 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
24412 KB |
Output is correct |
2 |
Correct |
4 ms |
24504 KB |
Output is correct |
3 |
Correct |
3 ms |
24508 KB |
Output is correct |
4 |
Correct |
3 ms |
24412 KB |
Output is correct |
5 |
Correct |
4 ms |
24412 KB |
Output is correct |
6 |
Correct |
3 ms |
24412 KB |
Output is correct |
7 |
Correct |
91 ms |
90964 KB |
Output is correct |
8 |
Correct |
83 ms |
90944 KB |
Output is correct |
9 |
Correct |
3 ms |
24408 KB |
Output is correct |
10 |
Correct |
3 ms |
24412 KB |
Output is correct |
11 |
Correct |
3 ms |
24412 KB |
Output is correct |
12 |
Correct |
4 ms |
24520 KB |
Output is correct |
13 |
Correct |
4 ms |
25180 KB |
Output is correct |
14 |
Correct |
5 ms |
25060 KB |
Output is correct |
15 |
Correct |
4 ms |
25176 KB |
Output is correct |
16 |
Correct |
4 ms |
25180 KB |
Output is correct |
17 |
Correct |
124 ms |
91232 KB |
Output is correct |
18 |
Correct |
109 ms |
91220 KB |
Output is correct |
19 |
Correct |
88 ms |
91224 KB |
Output is correct |
20 |
Correct |
87 ms |
91352 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
24408 KB |
Output is correct |
2 |
Correct |
4 ms |
24412 KB |
Output is correct |
3 |
Correct |
3 ms |
24412 KB |
Output is correct |
4 |
Correct |
4 ms |
24412 KB |
Output is correct |
5 |
Correct |
3 ms |
24412 KB |
Output is correct |
6 |
Correct |
3 ms |
24412 KB |
Output is correct |
7 |
Correct |
3 ms |
24412 KB |
Output is correct |
8 |
Correct |
3 ms |
24496 KB |
Output is correct |
9 |
Correct |
3 ms |
24412 KB |
Output is correct |
10 |
Correct |
3 ms |
24412 KB |
Output is correct |
11 |
Correct |
4 ms |
24668 KB |
Output is correct |
12 |
Correct |
4 ms |
24412 KB |
Output is correct |
13 |
Correct |
4 ms |
24668 KB |
Output is correct |
14 |
Correct |
4 ms |
24668 KB |
Output is correct |
15 |
Correct |
49 ms |
38368 KB |
Output is correct |
16 |
Correct |
48 ms |
37460 KB |
Output is correct |
17 |
Correct |
54 ms |
37968 KB |
Output is correct |
18 |
Correct |
51 ms |
38268 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
24412 KB |
Output is correct |
2 |
Correct |
4 ms |
24504 KB |
Output is correct |
3 |
Correct |
3 ms |
24412 KB |
Output is correct |
4 |
Correct |
3 ms |
24412 KB |
Output is correct |
5 |
Correct |
91 ms |
90964 KB |
Output is correct |
6 |
Correct |
83 ms |
90944 KB |
Output is correct |
7 |
Correct |
3 ms |
24412 KB |
Output is correct |
8 |
Correct |
4 ms |
24444 KB |
Output is correct |
9 |
Correct |
4 ms |
24668 KB |
Output is correct |
10 |
Correct |
4 ms |
24668 KB |
Output is correct |
11 |
Correct |
72 ms |
54768 KB |
Output is correct |
12 |
Correct |
93 ms |
49420 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
24412 KB |
Output is correct |
2 |
Correct |
3 ms |
24412 KB |
Output is correct |
3 |
Correct |
3 ms |
24412 KB |
Output is correct |
4 |
Correct |
3 ms |
24412 KB |
Output is correct |
5 |
Correct |
4 ms |
24504 KB |
Output is correct |
6 |
Correct |
3 ms |
24508 KB |
Output is correct |
7 |
Correct |
3 ms |
24412 KB |
Output is correct |
8 |
Correct |
4 ms |
24412 KB |
Output is correct |
9 |
Correct |
3 ms |
24412 KB |
Output is correct |
10 |
Correct |
3 ms |
24412 KB |
Output is correct |
11 |
Correct |
3 ms |
24412 KB |
Output is correct |
12 |
Correct |
5 ms |
24540 KB |
Output is correct |
13 |
Correct |
4 ms |
24412 KB |
Output is correct |
14 |
Correct |
3 ms |
24412 KB |
Output is correct |
15 |
Correct |
3 ms |
24412 KB |
Output is correct |
16 |
Correct |
3 ms |
24412 KB |
Output is correct |
17 |
Correct |
3 ms |
24412 KB |
Output is correct |
18 |
Correct |
3 ms |
24408 KB |
Output is correct |
19 |
Correct |
3 ms |
24500 KB |
Output is correct |
20 |
Correct |
5 ms |
24496 KB |
Output is correct |
21 |
Correct |
3 ms |
24412 KB |
Output is correct |
22 |
Correct |
3 ms |
24488 KB |
Output is correct |
23 |
Correct |
4 ms |
24524 KB |
Output is correct |
24 |
Correct |
3 ms |
24412 KB |
Output is correct |
25 |
Correct |
3 ms |
24412 KB |
Output is correct |
26 |
Correct |
3 ms |
24412 KB |
Output is correct |
27 |
Correct |
3 ms |
24412 KB |
Output is correct |
28 |
Correct |
3 ms |
24412 KB |
Output is correct |
29 |
Correct |
3 ms |
24412 KB |
Output is correct |
30 |
Correct |
4 ms |
24412 KB |
Output is correct |
31 |
Correct |
3 ms |
24532 KB |
Output is correct |
32 |
Correct |
3 ms |
24512 KB |
Output is correct |
33 |
Correct |
3 ms |
24516 KB |
Output is correct |
34 |
Correct |
3 ms |
24412 KB |
Output is correct |
35 |
Correct |
3 ms |
24412 KB |
Output is correct |
36 |
Correct |
3 ms |
24412 KB |
Output is correct |
37 |
Correct |
3 ms |
24412 KB |
Output is correct |
38 |
Correct |
3 ms |
24408 KB |
Output is correct |
39 |
Correct |
3 ms |
24412 KB |
Output is correct |
40 |
Correct |
3 ms |
24412 KB |
Output is correct |
41 |
Correct |
4 ms |
24520 KB |
Output is correct |
42 |
Correct |
4 ms |
24408 KB |
Output is correct |
43 |
Correct |
4 ms |
24412 KB |
Output is correct |
44 |
Correct |
3 ms |
24412 KB |
Output is correct |
45 |
Correct |
4 ms |
24412 KB |
Output is correct |
46 |
Correct |
3 ms |
24412 KB |
Output is correct |
47 |
Correct |
3 ms |
24412 KB |
Output is correct |
48 |
Correct |
3 ms |
24412 KB |
Output is correct |
49 |
Correct |
3 ms |
24496 KB |
Output is correct |
50 |
Correct |
3 ms |
24412 KB |
Output is correct |
51 |
Correct |
3 ms |
24412 KB |
Output is correct |
52 |
Correct |
3 ms |
24412 KB |
Output is correct |
53 |
Correct |
4 ms |
24444 KB |
Output is correct |
54 |
Correct |
4 ms |
24408 KB |
Output is correct |
55 |
Correct |
3 ms |
24412 KB |
Output is correct |
56 |
Correct |
3 ms |
24412 KB |
Output is correct |
57 |
Correct |
3 ms |
24412 KB |
Output is correct |
58 |
Correct |
3 ms |
24412 KB |
Output is correct |
59 |
Correct |
3 ms |
24408 KB |
Output is correct |
60 |
Correct |
3 ms |
24412 KB |
Output is correct |
61 |
Correct |
3 ms |
24412 KB |
Output is correct |
62 |
Correct |
3 ms |
24540 KB |
Output is correct |
63 |
Correct |
3 ms |
24412 KB |
Output is correct |
64 |
Correct |
3 ms |
24408 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
24412 KB |
Output is correct |
2 |
Correct |
4 ms |
24504 KB |
Output is correct |
3 |
Correct |
3 ms |
24412 KB |
Output is correct |
4 |
Correct |
3 ms |
24412 KB |
Output is correct |
5 |
Correct |
5 ms |
24540 KB |
Output is correct |
6 |
Correct |
4 ms |
24412 KB |
Output is correct |
7 |
Correct |
3 ms |
24412 KB |
Output is correct |
8 |
Correct |
3 ms |
24412 KB |
Output is correct |
9 |
Correct |
3 ms |
24412 KB |
Output is correct |
10 |
Correct |
3 ms |
24412 KB |
Output is correct |
11 |
Correct |
3 ms |
24408 KB |
Output is correct |
12 |
Correct |
3 ms |
24500 KB |
Output is correct |
13 |
Correct |
5 ms |
24496 KB |
Output is correct |
14 |
Correct |
3 ms |
24412 KB |
Output is correct |
15 |
Correct |
3 ms |
24488 KB |
Output is correct |
16 |
Correct |
4 ms |
24524 KB |
Output is correct |
17 |
Correct |
3 ms |
24412 KB |
Output is correct |
18 |
Correct |
3 ms |
24412 KB |
Output is correct |
19 |
Correct |
3 ms |
24412 KB |
Output is correct |
20 |
Correct |
3 ms |
24412 KB |
Output is correct |
21 |
Correct |
3 ms |
24412 KB |
Output is correct |
22 |
Correct |
3 ms |
24412 KB |
Output is correct |
23 |
Correct |
4 ms |
24412 KB |
Output is correct |
24 |
Correct |
3 ms |
24532 KB |
Output is correct |
25 |
Correct |
5 ms |
25180 KB |
Output is correct |
26 |
Correct |
4 ms |
25180 KB |
Output is correct |
27 |
Correct |
4 ms |
25180 KB |
Output is correct |
28 |
Correct |
5 ms |
25180 KB |
Output is correct |
29 |
Correct |
4 ms |
25180 KB |
Output is correct |
30 |
Correct |
4 ms |
24920 KB |
Output is correct |
31 |
Correct |
4 ms |
24668 KB |
Output is correct |
32 |
Correct |
4 ms |
24668 KB |
Output is correct |
33 |
Correct |
4 ms |
24668 KB |
Output is correct |
34 |
Correct |
4 ms |
24800 KB |
Output is correct |
35 |
Correct |
4 ms |
24664 KB |
Output is correct |
36 |
Correct |
4 ms |
24668 KB |
Output is correct |
37 |
Correct |
4 ms |
24668 KB |
Output is correct |
38 |
Correct |
4 ms |
24668 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
24412 KB |
Output is correct |
2 |
Correct |
3 ms |
24412 KB |
Output is correct |
3 |
Correct |
3 ms |
24412 KB |
Output is correct |
4 |
Correct |
3 ms |
24412 KB |
Output is correct |
5 |
Correct |
4 ms |
24504 KB |
Output is correct |
6 |
Correct |
3 ms |
24508 KB |
Output is correct |
7 |
Correct |
3 ms |
24412 KB |
Output is correct |
8 |
Correct |
4 ms |
24412 KB |
Output is correct |
9 |
Correct |
3 ms |
24412 KB |
Output is correct |
10 |
Correct |
3 ms |
24412 KB |
Output is correct |
11 |
Correct |
3 ms |
24412 KB |
Output is correct |
12 |
Correct |
5 ms |
24540 KB |
Output is correct |
13 |
Correct |
4 ms |
24412 KB |
Output is correct |
14 |
Correct |
3 ms |
24412 KB |
Output is correct |
15 |
Correct |
3 ms |
24412 KB |
Output is correct |
16 |
Correct |
3 ms |
24412 KB |
Output is correct |
17 |
Correct |
3 ms |
24412 KB |
Output is correct |
18 |
Correct |
3 ms |
24408 KB |
Output is correct |
19 |
Correct |
3 ms |
24500 KB |
Output is correct |
20 |
Correct |
5 ms |
24496 KB |
Output is correct |
21 |
Correct |
3 ms |
24412 KB |
Output is correct |
22 |
Correct |
3 ms |
24488 KB |
Output is correct |
23 |
Correct |
4 ms |
24524 KB |
Output is correct |
24 |
Correct |
3 ms |
24412 KB |
Output is correct |
25 |
Correct |
3 ms |
24412 KB |
Output is correct |
26 |
Correct |
3 ms |
24412 KB |
Output is correct |
27 |
Correct |
3 ms |
24412 KB |
Output is correct |
28 |
Correct |
3 ms |
24412 KB |
Output is correct |
29 |
Correct |
3 ms |
24412 KB |
Output is correct |
30 |
Correct |
4 ms |
24412 KB |
Output is correct |
31 |
Correct |
3 ms |
24532 KB |
Output is correct |
32 |
Correct |
3 ms |
24512 KB |
Output is correct |
33 |
Correct |
3 ms |
24516 KB |
Output is correct |
34 |
Correct |
3 ms |
24412 KB |
Output is correct |
35 |
Correct |
3 ms |
24412 KB |
Output is correct |
36 |
Correct |
3 ms |
24412 KB |
Output is correct |
37 |
Correct |
3 ms |
24412 KB |
Output is correct |
38 |
Correct |
3 ms |
24408 KB |
Output is correct |
39 |
Correct |
3 ms |
24412 KB |
Output is correct |
40 |
Correct |
3 ms |
24412 KB |
Output is correct |
41 |
Correct |
4 ms |
24520 KB |
Output is correct |
42 |
Correct |
4 ms |
25180 KB |
Output is correct |
43 |
Correct |
5 ms |
25060 KB |
Output is correct |
44 |
Correct |
4 ms |
25176 KB |
Output is correct |
45 |
Correct |
4 ms |
25180 KB |
Output is correct |
46 |
Correct |
4 ms |
24408 KB |
Output is correct |
47 |
Correct |
4 ms |
24412 KB |
Output is correct |
48 |
Correct |
3 ms |
24412 KB |
Output is correct |
49 |
Correct |
4 ms |
24412 KB |
Output is correct |
50 |
Correct |
3 ms |
24412 KB |
Output is correct |
51 |
Correct |
3 ms |
24412 KB |
Output is correct |
52 |
Correct |
3 ms |
24412 KB |
Output is correct |
53 |
Correct |
3 ms |
24496 KB |
Output is correct |
54 |
Correct |
3 ms |
24412 KB |
Output is correct |
55 |
Correct |
3 ms |
24412 KB |
Output is correct |
56 |
Correct |
4 ms |
24668 KB |
Output is correct |
57 |
Correct |
4 ms |
24412 KB |
Output is correct |
58 |
Correct |
4 ms |
24668 KB |
Output is correct |
59 |
Correct |
4 ms |
24668 KB |
Output is correct |
60 |
Correct |
3 ms |
24412 KB |
Output is correct |
61 |
Correct |
4 ms |
24444 KB |
Output is correct |
62 |
Correct |
4 ms |
24668 KB |
Output is correct |
63 |
Correct |
4 ms |
24668 KB |
Output is correct |
64 |
Correct |
4 ms |
24408 KB |
Output is correct |
65 |
Correct |
3 ms |
24412 KB |
Output is correct |
66 |
Correct |
3 ms |
24412 KB |
Output is correct |
67 |
Correct |
3 ms |
24412 KB |
Output is correct |
68 |
Correct |
3 ms |
24412 KB |
Output is correct |
69 |
Correct |
3 ms |
24408 KB |
Output is correct |
70 |
Correct |
3 ms |
24412 KB |
Output is correct |
71 |
Correct |
3 ms |
24412 KB |
Output is correct |
72 |
Correct |
3 ms |
24540 KB |
Output is correct |
73 |
Correct |
3 ms |
24412 KB |
Output is correct |
74 |
Correct |
3 ms |
24408 KB |
Output is correct |
75 |
Correct |
5 ms |
25180 KB |
Output is correct |
76 |
Correct |
4 ms |
25180 KB |
Output is correct |
77 |
Correct |
4 ms |
25180 KB |
Output is correct |
78 |
Correct |
5 ms |
25180 KB |
Output is correct |
79 |
Correct |
4 ms |
25180 KB |
Output is correct |
80 |
Correct |
4 ms |
24920 KB |
Output is correct |
81 |
Correct |
4 ms |
24668 KB |
Output is correct |
82 |
Correct |
4 ms |
24668 KB |
Output is correct |
83 |
Correct |
4 ms |
24668 KB |
Output is correct |
84 |
Correct |
4 ms |
24800 KB |
Output is correct |
85 |
Correct |
4 ms |
24664 KB |
Output is correct |
86 |
Correct |
4 ms |
24668 KB |
Output is correct |
87 |
Correct |
4 ms |
24668 KB |
Output is correct |
88 |
Correct |
4 ms |
24668 KB |
Output is correct |
89 |
Correct |
4 ms |
24920 KB |
Output is correct |
90 |
Correct |
4 ms |
24668 KB |
Output is correct |
91 |
Correct |
4 ms |
24668 KB |
Output is correct |
92 |
Correct |
4 ms |
24668 KB |
Output is correct |
93 |
Correct |
4 ms |
24780 KB |
Output is correct |
94 |
Correct |
4 ms |
24668 KB |
Output is correct |
95 |
Correct |
4 ms |
24668 KB |
Output is correct |
96 |
Correct |
4 ms |
24668 KB |
Output is correct |
97 |
Correct |
4 ms |
24668 KB |
Output is correct |
98 |
Correct |
4 ms |
24668 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
24412 KB |
Output is correct |
2 |
Correct |
4 ms |
24504 KB |
Output is correct |
3 |
Correct |
3 ms |
24412 KB |
Output is correct |
4 |
Correct |
3 ms |
24412 KB |
Output is correct |
5 |
Correct |
5 ms |
24540 KB |
Output is correct |
6 |
Correct |
4 ms |
24412 KB |
Output is correct |
7 |
Correct |
3 ms |
24412 KB |
Output is correct |
8 |
Correct |
3 ms |
24412 KB |
Output is correct |
9 |
Correct |
3 ms |
24412 KB |
Output is correct |
10 |
Correct |
3 ms |
24412 KB |
Output is correct |
11 |
Correct |
3 ms |
24408 KB |
Output is correct |
12 |
Correct |
3 ms |
24500 KB |
Output is correct |
13 |
Correct |
5 ms |
24496 KB |
Output is correct |
14 |
Correct |
3 ms |
24412 KB |
Output is correct |
15 |
Correct |
3 ms |
24488 KB |
Output is correct |
16 |
Correct |
4 ms |
24524 KB |
Output is correct |
17 |
Correct |
3 ms |
24412 KB |
Output is correct |
18 |
Correct |
3 ms |
24412 KB |
Output is correct |
19 |
Correct |
3 ms |
24412 KB |
Output is correct |
20 |
Correct |
3 ms |
24412 KB |
Output is correct |
21 |
Correct |
3 ms |
24412 KB |
Output is correct |
22 |
Correct |
3 ms |
24412 KB |
Output is correct |
23 |
Correct |
4 ms |
24412 KB |
Output is correct |
24 |
Correct |
3 ms |
24532 KB |
Output is correct |
25 |
Correct |
5 ms |
25180 KB |
Output is correct |
26 |
Correct |
4 ms |
25180 KB |
Output is correct |
27 |
Correct |
4 ms |
25180 KB |
Output is correct |
28 |
Correct |
5 ms |
25180 KB |
Output is correct |
29 |
Correct |
4 ms |
25180 KB |
Output is correct |
30 |
Correct |
4 ms |
24920 KB |
Output is correct |
31 |
Correct |
4 ms |
24668 KB |
Output is correct |
32 |
Correct |
4 ms |
24668 KB |
Output is correct |
33 |
Correct |
4 ms |
24668 KB |
Output is correct |
34 |
Correct |
4 ms |
24800 KB |
Output is correct |
35 |
Correct |
4 ms |
24664 KB |
Output is correct |
36 |
Correct |
4 ms |
24668 KB |
Output is correct |
37 |
Correct |
4 ms |
24668 KB |
Output is correct |
38 |
Correct |
4 ms |
24668 KB |
Output is correct |
39 |
Correct |
122 ms |
90456 KB |
Output is correct |
40 |
Correct |
108 ms |
90452 KB |
Output is correct |
41 |
Correct |
98 ms |
90452 KB |
Output is correct |
42 |
Correct |
81 ms |
90296 KB |
Output is correct |
43 |
Correct |
117 ms |
77744 KB |
Output is correct |
44 |
Correct |
96 ms |
60144 KB |
Output is correct |
45 |
Correct |
131 ms |
55120 KB |
Output is correct |
46 |
Correct |
113 ms |
55516 KB |
Output is correct |
47 |
Correct |
105 ms |
55264 KB |
Output is correct |
48 |
Correct |
95 ms |
55036 KB |
Output is correct |
49 |
Correct |
73 ms |
53952 KB |
Output is correct |
50 |
Correct |
116 ms |
52820 KB |
Output is correct |
51 |
Correct |
103 ms |
53228 KB |
Output is correct |
52 |
Correct |
95 ms |
53976 KB |
Output is correct |
53 |
Correct |
102 ms |
54096 KB |
Output is correct |
54 |
Correct |
69 ms |
51720 KB |
Output is correct |
55 |
Correct |
82 ms |
65132 KB |
Output is correct |
56 |
Correct |
79 ms |
65620 KB |
Output is correct |
57 |
Correct |
67 ms |
54096 KB |
Output is correct |
58 |
Correct |
64 ms |
53072 KB |
Output is correct |
59 |
Correct |
70 ms |
52944 KB |
Output is correct |
60 |
Correct |
65 ms |
52776 KB |
Output is correct |
61 |
Correct |
64 ms |
52960 KB |
Output is correct |
62 |
Correct |
69 ms |
52816 KB |
Output is correct |
63 |
Correct |
86 ms |
61444 KB |
Output is correct |
64 |
Correct |
89 ms |
59472 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
24412 KB |
Output is correct |
2 |
Correct |
3 ms |
24412 KB |
Output is correct |
3 |
Correct |
3 ms |
24412 KB |
Output is correct |
4 |
Correct |
3 ms |
24412 KB |
Output is correct |
5 |
Correct |
4 ms |
24504 KB |
Output is correct |
6 |
Correct |
3 ms |
24508 KB |
Output is correct |
7 |
Correct |
3 ms |
24412 KB |
Output is correct |
8 |
Correct |
4 ms |
24412 KB |
Output is correct |
9 |
Correct |
3 ms |
24412 KB |
Output is correct |
10 |
Correct |
3 ms |
24412 KB |
Output is correct |
11 |
Correct |
3 ms |
24412 KB |
Output is correct |
12 |
Correct |
5 ms |
24540 KB |
Output is correct |
13 |
Correct |
4 ms |
24412 KB |
Output is correct |
14 |
Correct |
3 ms |
24412 KB |
Output is correct |
15 |
Correct |
3 ms |
24412 KB |
Output is correct |
16 |
Correct |
3 ms |
24412 KB |
Output is correct |
17 |
Correct |
3 ms |
24412 KB |
Output is correct |
18 |
Correct |
3 ms |
24408 KB |
Output is correct |
19 |
Correct |
3 ms |
24500 KB |
Output is correct |
20 |
Correct |
5 ms |
24496 KB |
Output is correct |
21 |
Correct |
3 ms |
24412 KB |
Output is correct |
22 |
Correct |
3 ms |
24488 KB |
Output is correct |
23 |
Correct |
4 ms |
24524 KB |
Output is correct |
24 |
Correct |
3 ms |
24412 KB |
Output is correct |
25 |
Correct |
3 ms |
24412 KB |
Output is correct |
26 |
Correct |
3 ms |
24412 KB |
Output is correct |
27 |
Correct |
3 ms |
24412 KB |
Output is correct |
28 |
Correct |
3 ms |
24412 KB |
Output is correct |
29 |
Correct |
3 ms |
24412 KB |
Output is correct |
30 |
Correct |
4 ms |
24412 KB |
Output is correct |
31 |
Correct |
3 ms |
24532 KB |
Output is correct |
32 |
Correct |
3 ms |
24512 KB |
Output is correct |
33 |
Correct |
3 ms |
24516 KB |
Output is correct |
34 |
Correct |
3 ms |
24412 KB |
Output is correct |
35 |
Correct |
3 ms |
24412 KB |
Output is correct |
36 |
Correct |
3 ms |
24412 KB |
Output is correct |
37 |
Correct |
3 ms |
24412 KB |
Output is correct |
38 |
Correct |
91 ms |
90964 KB |
Output is correct |
39 |
Correct |
83 ms |
90944 KB |
Output is correct |
40 |
Correct |
3 ms |
24408 KB |
Output is correct |
41 |
Correct |
3 ms |
24412 KB |
Output is correct |
42 |
Correct |
3 ms |
24412 KB |
Output is correct |
43 |
Correct |
4 ms |
24520 KB |
Output is correct |
44 |
Correct |
4 ms |
25180 KB |
Output is correct |
45 |
Correct |
5 ms |
25060 KB |
Output is correct |
46 |
Correct |
4 ms |
25176 KB |
Output is correct |
47 |
Correct |
4 ms |
25180 KB |
Output is correct |
48 |
Correct |
124 ms |
91232 KB |
Output is correct |
49 |
Correct |
109 ms |
91220 KB |
Output is correct |
50 |
Correct |
88 ms |
91224 KB |
Output is correct |
51 |
Correct |
87 ms |
91352 KB |
Output is correct |
52 |
Correct |
4 ms |
24408 KB |
Output is correct |
53 |
Correct |
4 ms |
24412 KB |
Output is correct |
54 |
Correct |
3 ms |
24412 KB |
Output is correct |
55 |
Correct |
4 ms |
24412 KB |
Output is correct |
56 |
Correct |
3 ms |
24412 KB |
Output is correct |
57 |
Correct |
3 ms |
24412 KB |
Output is correct |
58 |
Correct |
3 ms |
24412 KB |
Output is correct |
59 |
Correct |
3 ms |
24496 KB |
Output is correct |
60 |
Correct |
3 ms |
24412 KB |
Output is correct |
61 |
Correct |
3 ms |
24412 KB |
Output is correct |
62 |
Correct |
4 ms |
24668 KB |
Output is correct |
63 |
Correct |
4 ms |
24412 KB |
Output is correct |
64 |
Correct |
4 ms |
24668 KB |
Output is correct |
65 |
Correct |
4 ms |
24668 KB |
Output is correct |
66 |
Correct |
49 ms |
38368 KB |
Output is correct |
67 |
Correct |
48 ms |
37460 KB |
Output is correct |
68 |
Correct |
54 ms |
37968 KB |
Output is correct |
69 |
Correct |
51 ms |
38268 KB |
Output is correct |
70 |
Correct |
3 ms |
24412 KB |
Output is correct |
71 |
Correct |
4 ms |
24444 KB |
Output is correct |
72 |
Correct |
4 ms |
24668 KB |
Output is correct |
73 |
Correct |
4 ms |
24668 KB |
Output is correct |
74 |
Correct |
72 ms |
54768 KB |
Output is correct |
75 |
Correct |
93 ms |
49420 KB |
Output is correct |
76 |
Correct |
4 ms |
24408 KB |
Output is correct |
77 |
Correct |
3 ms |
24412 KB |
Output is correct |
78 |
Correct |
3 ms |
24412 KB |
Output is correct |
79 |
Correct |
3 ms |
24412 KB |
Output is correct |
80 |
Correct |
3 ms |
24412 KB |
Output is correct |
81 |
Correct |
3 ms |
24408 KB |
Output is correct |
82 |
Correct |
3 ms |
24412 KB |
Output is correct |
83 |
Correct |
3 ms |
24412 KB |
Output is correct |
84 |
Correct |
3 ms |
24540 KB |
Output is correct |
85 |
Correct |
3 ms |
24412 KB |
Output is correct |
86 |
Correct |
3 ms |
24408 KB |
Output is correct |
87 |
Correct |
5 ms |
25180 KB |
Output is correct |
88 |
Correct |
4 ms |
25180 KB |
Output is correct |
89 |
Correct |
4 ms |
25180 KB |
Output is correct |
90 |
Correct |
5 ms |
25180 KB |
Output is correct |
91 |
Correct |
4 ms |
25180 KB |
Output is correct |
92 |
Correct |
4 ms |
24920 KB |
Output is correct |
93 |
Correct |
4 ms |
24668 KB |
Output is correct |
94 |
Correct |
4 ms |
24668 KB |
Output is correct |
95 |
Correct |
4 ms |
24668 KB |
Output is correct |
96 |
Correct |
4 ms |
24800 KB |
Output is correct |
97 |
Correct |
4 ms |
24664 KB |
Output is correct |
98 |
Correct |
4 ms |
24668 KB |
Output is correct |
99 |
Correct |
4 ms |
24668 KB |
Output is correct |
100 |
Correct |
4 ms |
24668 KB |
Output is correct |
101 |
Correct |
4 ms |
24920 KB |
Output is correct |
102 |
Correct |
4 ms |
24668 KB |
Output is correct |
103 |
Correct |
4 ms |
24668 KB |
Output is correct |
104 |
Correct |
4 ms |
24668 KB |
Output is correct |
105 |
Correct |
4 ms |
24780 KB |
Output is correct |
106 |
Correct |
4 ms |
24668 KB |
Output is correct |
107 |
Correct |
4 ms |
24668 KB |
Output is correct |
108 |
Correct |
4 ms |
24668 KB |
Output is correct |
109 |
Correct |
4 ms |
24668 KB |
Output is correct |
110 |
Correct |
4 ms |
24668 KB |
Output is correct |
111 |
Correct |
122 ms |
90456 KB |
Output is correct |
112 |
Correct |
108 ms |
90452 KB |
Output is correct |
113 |
Correct |
98 ms |
90452 KB |
Output is correct |
114 |
Correct |
81 ms |
90296 KB |
Output is correct |
115 |
Correct |
117 ms |
77744 KB |
Output is correct |
116 |
Correct |
96 ms |
60144 KB |
Output is correct |
117 |
Correct |
131 ms |
55120 KB |
Output is correct |
118 |
Correct |
113 ms |
55516 KB |
Output is correct |
119 |
Correct |
105 ms |
55264 KB |
Output is correct |
120 |
Correct |
95 ms |
55036 KB |
Output is correct |
121 |
Correct |
73 ms |
53952 KB |
Output is correct |
122 |
Correct |
116 ms |
52820 KB |
Output is correct |
123 |
Correct |
103 ms |
53228 KB |
Output is correct |
124 |
Correct |
95 ms |
53976 KB |
Output is correct |
125 |
Correct |
102 ms |
54096 KB |
Output is correct |
126 |
Correct |
69 ms |
51720 KB |
Output is correct |
127 |
Correct |
82 ms |
65132 KB |
Output is correct |
128 |
Correct |
79 ms |
65620 KB |
Output is correct |
129 |
Correct |
67 ms |
54096 KB |
Output is correct |
130 |
Correct |
64 ms |
53072 KB |
Output is correct |
131 |
Correct |
70 ms |
52944 KB |
Output is correct |
132 |
Correct |
65 ms |
52776 KB |
Output is correct |
133 |
Correct |
64 ms |
52960 KB |
Output is correct |
134 |
Correct |
69 ms |
52816 KB |
Output is correct |
135 |
Correct |
86 ms |
61444 KB |
Output is correct |
136 |
Correct |
89 ms |
59472 KB |
Output is correct |
137 |
Correct |
122 ms |
71876 KB |
Output is correct |
138 |
Correct |
92 ms |
62056 KB |
Output is correct |
139 |
Correct |
127 ms |
55632 KB |
Output is correct |
140 |
Correct |
114 ms |
55632 KB |
Output is correct |
141 |
Correct |
103 ms |
55632 KB |
Output is correct |
142 |
Correct |
99 ms |
55396 KB |
Output is correct |
143 |
Correct |
74 ms |
54868 KB |
Output is correct |
144 |
Correct |
117 ms |
52564 KB |
Output is correct |
145 |
Correct |
101 ms |
53464 KB |
Output is correct |
146 |
Correct |
94 ms |
53332 KB |
Output is correct |
147 |
Correct |
102 ms |
55136 KB |
Output is correct |
148 |
Correct |
79 ms |
52492 KB |
Output is correct |
149 |
Correct |
76 ms |
65360 KB |
Output is correct |
150 |
Correct |
77 ms |
65644 KB |
Output is correct |
151 |
Correct |
70 ms |
55020 KB |
Output is correct |
152 |
Correct |
67 ms |
54088 KB |
Output is correct |
153 |
Correct |
66 ms |
53844 KB |
Output is correct |
154 |
Correct |
66 ms |
53664 KB |
Output is correct |
155 |
Correct |
65 ms |
53840 KB |
Output is correct |
156 |
Correct |
65 ms |
53584 KB |
Output is correct |
157 |
Correct |
93 ms |
62288 KB |
Output is correct |
158 |
Correct |
86 ms |
60252 KB |
Output is correct |