// model_solution/solution-1.cpp
#include "beechtree.h"
#include <map>
#include <set>
#include <algorithm>
using namespace std;
using pii = pair<int, int>;
int n;
vector<int> par, col, sz;
vector<vector<int>> ch;
vector<map<int, int>> ch_colors;
vector<int> t;
vector<set<pii>> ord;
bool comp(int x, int y)
{
for (auto [c, sx] : ch_colors[x])
{
if (!ch_colors[y].count(c))
return false;
int sy = ch_colors[y][c];
if (sz[sx] > sz[sy])
return false;
}
return true;
}
bool merge(int u, int v)
{
if (ord[u].size() < ord[v].size())
{
swap(ord[u], ord[v]);
}
for (auto [s, x] : ord[v])
{
auto [it, b] = ord[u].insert({s, x});
if (it != ord[u].begin() && !comp(prev(it)->second, it->second))
return false;
if (next(it) != ord[u].end() && !comp(it->second, next(it)->second))
return false;
}
return true;
}
void dfs(int u)
{
ord[u].insert({sz[u], u});
for (int v : ch[u])
{
dfs(v);
if (t[v] == 0 || !merge(u, v))
{
t[u] = 0;
}
}
}
std::vector<int> beechtree(int N, int /*M*/, std::vector<int> P, std::vector<int> C)
{
n = N, par = P, col = C;
sz.assign(n, 1);
ch.resize(n), ch_colors.resize(n);
ord.resize(n);
t.assign(n, 1);
for (int v = n - 1; v > 0; --v)
{
int u = par[v];
sz[u] += sz[v];
ch[u].push_back(v);
if (ch_colors[u].count(col[v]))
{
t[u] = 0;
}
ch_colors[u][col[v]] = v;
}
dfs(0);
return t;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
288 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
284 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
284 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
0 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
288 KB |
Output is correct |
14 |
Correct |
0 ms |
212 KB |
Output is correct |
15 |
Correct |
1 ms |
212 KB |
Output is correct |
16 |
Correct |
0 ms |
212 KB |
Output is correct |
17 |
Correct |
0 ms |
212 KB |
Output is correct |
18 |
Correct |
0 ms |
212 KB |
Output is correct |
19 |
Correct |
0 ms |
212 KB |
Output is correct |
20 |
Correct |
1 ms |
212 KB |
Output is correct |
21 |
Correct |
0 ms |
212 KB |
Output is correct |
22 |
Correct |
0 ms |
212 KB |
Output is correct |
23 |
Correct |
0 ms |
212 KB |
Output is correct |
24 |
Correct |
0 ms |
212 KB |
Output is correct |
25 |
Correct |
0 ms |
212 KB |
Output is correct |
26 |
Correct |
0 ms |
212 KB |
Output is correct |
27 |
Correct |
0 ms |
212 KB |
Output is correct |
28 |
Correct |
0 ms |
212 KB |
Output is correct |
29 |
Correct |
0 ms |
212 KB |
Output is correct |
30 |
Correct |
0 ms |
292 KB |
Output is correct |
31 |
Correct |
0 ms |
212 KB |
Output is correct |
32 |
Correct |
0 ms |
212 KB |
Output is correct |
33 |
Correct |
0 ms |
212 KB |
Output is correct |
34 |
Correct |
0 ms |
284 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
284 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
89 ms |
73496 KB |
Output is correct |
8 |
Correct |
97 ms |
72972 KB |
Output is correct |
9 |
Correct |
0 ms |
340 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
1 ms |
340 KB |
Output is correct |
12 |
Correct |
0 ms |
288 KB |
Output is correct |
13 |
Correct |
2 ms |
980 KB |
Output is correct |
14 |
Correct |
1 ms |
1060 KB |
Output is correct |
15 |
Correct |
1 ms |
980 KB |
Output is correct |
16 |
Correct |
1 ms |
980 KB |
Output is correct |
17 |
Correct |
149 ms |
82908 KB |
Output is correct |
18 |
Correct |
126 ms |
78012 KB |
Output is correct |
19 |
Correct |
102 ms |
75452 KB |
Output is correct |
20 |
Correct |
100 ms |
71472 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
284 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
292 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
596 KB |
Output is correct |
12 |
Correct |
1 ms |
596 KB |
Output is correct |
13 |
Correct |
1 ms |
596 KB |
Output is correct |
14 |
Correct |
1 ms |
596 KB |
Output is correct |
15 |
Correct |
113 ms |
37200 KB |
Output is correct |
16 |
Correct |
107 ms |
34668 KB |
Output is correct |
17 |
Correct |
106 ms |
35296 KB |
Output is correct |
18 |
Correct |
112 ms |
36084 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
284 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
89 ms |
73496 KB |
Output is correct |
6 |
Correct |
97 ms |
72972 KB |
Output is correct |
7 |
Correct |
0 ms |
284 KB |
Output is correct |
8 |
Correct |
1 ms |
288 KB |
Output is correct |
9 |
Correct |
1 ms |
852 KB |
Output is correct |
10 |
Correct |
2 ms |
852 KB |
Output is correct |
11 |
Correct |
143 ms |
63844 KB |
Output is correct |
12 |
Correct |
188 ms |
59208 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
288 KB |
Output is correct |
4 |
Correct |
1 ms |
284 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
284 KB |
Output is correct |
14 |
Correct |
0 ms |
212 KB |
Output is correct |
15 |
Correct |
0 ms |
212 KB |
Output is correct |
16 |
Correct |
0 ms |
288 KB |
Output is correct |
17 |
Correct |
0 ms |
212 KB |
Output is correct |
18 |
Correct |
1 ms |
212 KB |
Output is correct |
19 |
Correct |
0 ms |
212 KB |
Output is correct |
20 |
Correct |
0 ms |
212 KB |
Output is correct |
21 |
Correct |
0 ms |
212 KB |
Output is correct |
22 |
Correct |
0 ms |
212 KB |
Output is correct |
23 |
Correct |
1 ms |
212 KB |
Output is correct |
24 |
Correct |
0 ms |
212 KB |
Output is correct |
25 |
Correct |
0 ms |
212 KB |
Output is correct |
26 |
Correct |
0 ms |
212 KB |
Output is correct |
27 |
Correct |
0 ms |
212 KB |
Output is correct |
28 |
Correct |
0 ms |
212 KB |
Output is correct |
29 |
Correct |
0 ms |
212 KB |
Output is correct |
30 |
Correct |
0 ms |
212 KB |
Output is correct |
31 |
Correct |
0 ms |
212 KB |
Output is correct |
32 |
Correct |
0 ms |
212 KB |
Output is correct |
33 |
Correct |
0 ms |
292 KB |
Output is correct |
34 |
Correct |
0 ms |
212 KB |
Output is correct |
35 |
Correct |
0 ms |
212 KB |
Output is correct |
36 |
Correct |
0 ms |
212 KB |
Output is correct |
37 |
Correct |
0 ms |
284 KB |
Output is correct |
38 |
Correct |
0 ms |
340 KB |
Output is correct |
39 |
Correct |
1 ms |
340 KB |
Output is correct |
40 |
Correct |
1 ms |
340 KB |
Output is correct |
41 |
Correct |
0 ms |
288 KB |
Output is correct |
42 |
Correct |
1 ms |
212 KB |
Output is correct |
43 |
Correct |
0 ms |
212 KB |
Output is correct |
44 |
Correct |
1 ms |
212 KB |
Output is correct |
45 |
Correct |
1 ms |
212 KB |
Output is correct |
46 |
Correct |
1 ms |
284 KB |
Output is correct |
47 |
Correct |
0 ms |
212 KB |
Output is correct |
48 |
Correct |
1 ms |
292 KB |
Output is correct |
49 |
Correct |
1 ms |
212 KB |
Output is correct |
50 |
Correct |
1 ms |
212 KB |
Output is correct |
51 |
Correct |
0 ms |
212 KB |
Output is correct |
52 |
Correct |
0 ms |
284 KB |
Output is correct |
53 |
Correct |
1 ms |
288 KB |
Output is correct |
54 |
Correct |
1 ms |
340 KB |
Output is correct |
55 |
Correct |
1 ms |
340 KB |
Output is correct |
56 |
Correct |
0 ms |
340 KB |
Output is correct |
57 |
Correct |
1 ms |
284 KB |
Output is correct |
58 |
Correct |
0 ms |
340 KB |
Output is correct |
59 |
Correct |
1 ms |
344 KB |
Output is correct |
60 |
Correct |
0 ms |
340 KB |
Output is correct |
61 |
Correct |
1 ms |
340 KB |
Output is correct |
62 |
Correct |
1 ms |
292 KB |
Output is correct |
63 |
Correct |
0 ms |
340 KB |
Output is correct |
64 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
284 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
284 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
288 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
12 |
Correct |
0 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
14 |
Correct |
0 ms |
212 KB |
Output is correct |
15 |
Correct |
0 ms |
212 KB |
Output is correct |
16 |
Correct |
1 ms |
212 KB |
Output is correct |
17 |
Correct |
0 ms |
212 KB |
Output is correct |
18 |
Correct |
0 ms |
212 KB |
Output is correct |
19 |
Correct |
0 ms |
212 KB |
Output is correct |
20 |
Correct |
0 ms |
212 KB |
Output is correct |
21 |
Correct |
0 ms |
212 KB |
Output is correct |
22 |
Correct |
0 ms |
212 KB |
Output is correct |
23 |
Correct |
0 ms |
212 KB |
Output is correct |
24 |
Correct |
0 ms |
212 KB |
Output is correct |
25 |
Correct |
2 ms |
980 KB |
Output is correct |
26 |
Correct |
2 ms |
1072 KB |
Output is correct |
27 |
Correct |
2 ms |
936 KB |
Output is correct |
28 |
Correct |
2 ms |
936 KB |
Output is correct |
29 |
Correct |
2 ms |
980 KB |
Output is correct |
30 |
Correct |
2 ms |
852 KB |
Output is correct |
31 |
Correct |
2 ms |
1108 KB |
Output is correct |
32 |
Correct |
2 ms |
980 KB |
Output is correct |
33 |
Correct |
2 ms |
936 KB |
Output is correct |
34 |
Correct |
3 ms |
1236 KB |
Output is correct |
35 |
Correct |
2 ms |
1108 KB |
Output is correct |
36 |
Correct |
2 ms |
980 KB |
Output is correct |
37 |
Correct |
2 ms |
936 KB |
Output is correct |
38 |
Correct |
2 ms |
860 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
288 KB |
Output is correct |
4 |
Correct |
1 ms |
284 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
284 KB |
Output is correct |
14 |
Correct |
0 ms |
212 KB |
Output is correct |
15 |
Correct |
0 ms |
212 KB |
Output is correct |
16 |
Correct |
0 ms |
288 KB |
Output is correct |
17 |
Correct |
0 ms |
212 KB |
Output is correct |
18 |
Correct |
1 ms |
212 KB |
Output is correct |
19 |
Correct |
0 ms |
212 KB |
Output is correct |
20 |
Correct |
0 ms |
212 KB |
Output is correct |
21 |
Correct |
0 ms |
212 KB |
Output is correct |
22 |
Correct |
0 ms |
212 KB |
Output is correct |
23 |
Correct |
1 ms |
212 KB |
Output is correct |
24 |
Correct |
0 ms |
212 KB |
Output is correct |
25 |
Correct |
0 ms |
212 KB |
Output is correct |
26 |
Correct |
0 ms |
212 KB |
Output is correct |
27 |
Correct |
0 ms |
212 KB |
Output is correct |
28 |
Correct |
0 ms |
212 KB |
Output is correct |
29 |
Correct |
0 ms |
212 KB |
Output is correct |
30 |
Correct |
0 ms |
212 KB |
Output is correct |
31 |
Correct |
0 ms |
212 KB |
Output is correct |
32 |
Correct |
0 ms |
212 KB |
Output is correct |
33 |
Correct |
0 ms |
292 KB |
Output is correct |
34 |
Correct |
0 ms |
212 KB |
Output is correct |
35 |
Correct |
0 ms |
212 KB |
Output is correct |
36 |
Correct |
0 ms |
212 KB |
Output is correct |
37 |
Correct |
0 ms |
284 KB |
Output is correct |
38 |
Correct |
0 ms |
340 KB |
Output is correct |
39 |
Correct |
1 ms |
340 KB |
Output is correct |
40 |
Correct |
1 ms |
340 KB |
Output is correct |
41 |
Correct |
0 ms |
288 KB |
Output is correct |
42 |
Correct |
2 ms |
980 KB |
Output is correct |
43 |
Correct |
1 ms |
1060 KB |
Output is correct |
44 |
Correct |
1 ms |
980 KB |
Output is correct |
45 |
Correct |
1 ms |
980 KB |
Output is correct |
46 |
Correct |
1 ms |
212 KB |
Output is correct |
47 |
Correct |
0 ms |
212 KB |
Output is correct |
48 |
Correct |
1 ms |
212 KB |
Output is correct |
49 |
Correct |
1 ms |
212 KB |
Output is correct |
50 |
Correct |
1 ms |
284 KB |
Output is correct |
51 |
Correct |
0 ms |
212 KB |
Output is correct |
52 |
Correct |
1 ms |
292 KB |
Output is correct |
53 |
Correct |
1 ms |
212 KB |
Output is correct |
54 |
Correct |
1 ms |
212 KB |
Output is correct |
55 |
Correct |
0 ms |
212 KB |
Output is correct |
56 |
Correct |
1 ms |
596 KB |
Output is correct |
57 |
Correct |
1 ms |
596 KB |
Output is correct |
58 |
Correct |
1 ms |
596 KB |
Output is correct |
59 |
Correct |
1 ms |
596 KB |
Output is correct |
60 |
Correct |
0 ms |
284 KB |
Output is correct |
61 |
Correct |
1 ms |
288 KB |
Output is correct |
62 |
Correct |
1 ms |
852 KB |
Output is correct |
63 |
Correct |
2 ms |
852 KB |
Output is correct |
64 |
Correct |
1 ms |
340 KB |
Output is correct |
65 |
Correct |
1 ms |
340 KB |
Output is correct |
66 |
Correct |
0 ms |
340 KB |
Output is correct |
67 |
Correct |
1 ms |
284 KB |
Output is correct |
68 |
Correct |
0 ms |
340 KB |
Output is correct |
69 |
Correct |
1 ms |
344 KB |
Output is correct |
70 |
Correct |
0 ms |
340 KB |
Output is correct |
71 |
Correct |
1 ms |
340 KB |
Output is correct |
72 |
Correct |
1 ms |
292 KB |
Output is correct |
73 |
Correct |
0 ms |
340 KB |
Output is correct |
74 |
Correct |
1 ms |
344 KB |
Output is correct |
75 |
Correct |
2 ms |
980 KB |
Output is correct |
76 |
Correct |
2 ms |
1072 KB |
Output is correct |
77 |
Correct |
2 ms |
936 KB |
Output is correct |
78 |
Correct |
2 ms |
936 KB |
Output is correct |
79 |
Correct |
2 ms |
980 KB |
Output is correct |
80 |
Correct |
2 ms |
852 KB |
Output is correct |
81 |
Correct |
2 ms |
1108 KB |
Output is correct |
82 |
Correct |
2 ms |
980 KB |
Output is correct |
83 |
Correct |
2 ms |
936 KB |
Output is correct |
84 |
Correct |
3 ms |
1236 KB |
Output is correct |
85 |
Correct |
2 ms |
1108 KB |
Output is correct |
86 |
Correct |
2 ms |
980 KB |
Output is correct |
87 |
Correct |
2 ms |
936 KB |
Output is correct |
88 |
Correct |
2 ms |
860 KB |
Output is correct |
89 |
Correct |
3 ms |
1080 KB |
Output is correct |
90 |
Correct |
2 ms |
960 KB |
Output is correct |
91 |
Correct |
3 ms |
1248 KB |
Output is correct |
92 |
Correct |
3 ms |
1064 KB |
Output is correct |
93 |
Correct |
2 ms |
980 KB |
Output is correct |
94 |
Correct |
3 ms |
1076 KB |
Output is correct |
95 |
Correct |
2 ms |
1088 KB |
Output is correct |
96 |
Correct |
2 ms |
980 KB |
Output is correct |
97 |
Correct |
2 ms |
972 KB |
Output is correct |
98 |
Correct |
1 ms |
864 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
284 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
284 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
288 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
12 |
Correct |
0 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
14 |
Correct |
0 ms |
212 KB |
Output is correct |
15 |
Correct |
0 ms |
212 KB |
Output is correct |
16 |
Correct |
1 ms |
212 KB |
Output is correct |
17 |
Correct |
0 ms |
212 KB |
Output is correct |
18 |
Correct |
0 ms |
212 KB |
Output is correct |
19 |
Correct |
0 ms |
212 KB |
Output is correct |
20 |
Correct |
0 ms |
212 KB |
Output is correct |
21 |
Correct |
0 ms |
212 KB |
Output is correct |
22 |
Correct |
0 ms |
212 KB |
Output is correct |
23 |
Correct |
0 ms |
212 KB |
Output is correct |
24 |
Correct |
0 ms |
212 KB |
Output is correct |
25 |
Correct |
2 ms |
980 KB |
Output is correct |
26 |
Correct |
2 ms |
1072 KB |
Output is correct |
27 |
Correct |
2 ms |
936 KB |
Output is correct |
28 |
Correct |
2 ms |
936 KB |
Output is correct |
29 |
Correct |
2 ms |
980 KB |
Output is correct |
30 |
Correct |
2 ms |
852 KB |
Output is correct |
31 |
Correct |
2 ms |
1108 KB |
Output is correct |
32 |
Correct |
2 ms |
980 KB |
Output is correct |
33 |
Correct |
2 ms |
936 KB |
Output is correct |
34 |
Correct |
3 ms |
1236 KB |
Output is correct |
35 |
Correct |
2 ms |
1108 KB |
Output is correct |
36 |
Correct |
2 ms |
980 KB |
Output is correct |
37 |
Correct |
2 ms |
936 KB |
Output is correct |
38 |
Correct |
2 ms |
860 KB |
Output is correct |
39 |
Correct |
146 ms |
82256 KB |
Output is correct |
40 |
Correct |
136 ms |
78248 KB |
Output is correct |
41 |
Correct |
114 ms |
77148 KB |
Output is correct |
42 |
Correct |
100 ms |
72748 KB |
Output is correct |
43 |
Correct |
153 ms |
79988 KB |
Output is correct |
44 |
Correct |
141 ms |
71492 KB |
Output is correct |
45 |
Correct |
570 ms |
119844 KB |
Output is correct |
46 |
Correct |
307 ms |
98984 KB |
Output is correct |
47 |
Correct |
260 ms |
91404 KB |
Output is correct |
48 |
Correct |
190 ms |
78400 KB |
Output is correct |
49 |
Correct |
139 ms |
67320 KB |
Output is correct |
50 |
Correct |
503 ms |
127924 KB |
Output is correct |
51 |
Correct |
351 ms |
113628 KB |
Output is correct |
52 |
Correct |
270 ms |
93000 KB |
Output is correct |
53 |
Correct |
223 ms |
81400 KB |
Output is correct |
54 |
Correct |
168 ms |
67692 KB |
Output is correct |
55 |
Correct |
115 ms |
67524 KB |
Output is correct |
56 |
Correct |
121 ms |
68048 KB |
Output is correct |
57 |
Correct |
113 ms |
62936 KB |
Output is correct |
58 |
Correct |
105 ms |
62096 KB |
Output is correct |
59 |
Correct |
107 ms |
62196 KB |
Output is correct |
60 |
Correct |
106 ms |
62152 KB |
Output is correct |
61 |
Correct |
108 ms |
61920 KB |
Output is correct |
62 |
Correct |
108 ms |
61752 KB |
Output is correct |
63 |
Correct |
162 ms |
74448 KB |
Output is correct |
64 |
Correct |
134 ms |
68524 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
288 KB |
Output is correct |
4 |
Correct |
1 ms |
284 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
284 KB |
Output is correct |
14 |
Correct |
0 ms |
212 KB |
Output is correct |
15 |
Correct |
0 ms |
212 KB |
Output is correct |
16 |
Correct |
0 ms |
288 KB |
Output is correct |
17 |
Correct |
0 ms |
212 KB |
Output is correct |
18 |
Correct |
1 ms |
212 KB |
Output is correct |
19 |
Correct |
0 ms |
212 KB |
Output is correct |
20 |
Correct |
0 ms |
212 KB |
Output is correct |
21 |
Correct |
0 ms |
212 KB |
Output is correct |
22 |
Correct |
0 ms |
212 KB |
Output is correct |
23 |
Correct |
1 ms |
212 KB |
Output is correct |
24 |
Correct |
0 ms |
212 KB |
Output is correct |
25 |
Correct |
0 ms |
212 KB |
Output is correct |
26 |
Correct |
0 ms |
212 KB |
Output is correct |
27 |
Correct |
0 ms |
212 KB |
Output is correct |
28 |
Correct |
0 ms |
212 KB |
Output is correct |
29 |
Correct |
0 ms |
212 KB |
Output is correct |
30 |
Correct |
0 ms |
212 KB |
Output is correct |
31 |
Correct |
0 ms |
212 KB |
Output is correct |
32 |
Correct |
0 ms |
212 KB |
Output is correct |
33 |
Correct |
0 ms |
292 KB |
Output is correct |
34 |
Correct |
0 ms |
212 KB |
Output is correct |
35 |
Correct |
0 ms |
212 KB |
Output is correct |
36 |
Correct |
0 ms |
212 KB |
Output is correct |
37 |
Correct |
0 ms |
284 KB |
Output is correct |
38 |
Correct |
89 ms |
73496 KB |
Output is correct |
39 |
Correct |
97 ms |
72972 KB |
Output is correct |
40 |
Correct |
0 ms |
340 KB |
Output is correct |
41 |
Correct |
1 ms |
340 KB |
Output is correct |
42 |
Correct |
1 ms |
340 KB |
Output is correct |
43 |
Correct |
0 ms |
288 KB |
Output is correct |
44 |
Correct |
2 ms |
980 KB |
Output is correct |
45 |
Correct |
1 ms |
1060 KB |
Output is correct |
46 |
Correct |
1 ms |
980 KB |
Output is correct |
47 |
Correct |
1 ms |
980 KB |
Output is correct |
48 |
Correct |
149 ms |
82908 KB |
Output is correct |
49 |
Correct |
126 ms |
78012 KB |
Output is correct |
50 |
Correct |
102 ms |
75452 KB |
Output is correct |
51 |
Correct |
100 ms |
71472 KB |
Output is correct |
52 |
Correct |
1 ms |
212 KB |
Output is correct |
53 |
Correct |
0 ms |
212 KB |
Output is correct |
54 |
Correct |
1 ms |
212 KB |
Output is correct |
55 |
Correct |
1 ms |
212 KB |
Output is correct |
56 |
Correct |
1 ms |
284 KB |
Output is correct |
57 |
Correct |
0 ms |
212 KB |
Output is correct |
58 |
Correct |
1 ms |
292 KB |
Output is correct |
59 |
Correct |
1 ms |
212 KB |
Output is correct |
60 |
Correct |
1 ms |
212 KB |
Output is correct |
61 |
Correct |
0 ms |
212 KB |
Output is correct |
62 |
Correct |
1 ms |
596 KB |
Output is correct |
63 |
Correct |
1 ms |
596 KB |
Output is correct |
64 |
Correct |
1 ms |
596 KB |
Output is correct |
65 |
Correct |
1 ms |
596 KB |
Output is correct |
66 |
Correct |
113 ms |
37200 KB |
Output is correct |
67 |
Correct |
107 ms |
34668 KB |
Output is correct |
68 |
Correct |
106 ms |
35296 KB |
Output is correct |
69 |
Correct |
112 ms |
36084 KB |
Output is correct |
70 |
Correct |
0 ms |
284 KB |
Output is correct |
71 |
Correct |
1 ms |
288 KB |
Output is correct |
72 |
Correct |
1 ms |
852 KB |
Output is correct |
73 |
Correct |
2 ms |
852 KB |
Output is correct |
74 |
Correct |
143 ms |
63844 KB |
Output is correct |
75 |
Correct |
188 ms |
59208 KB |
Output is correct |
76 |
Correct |
1 ms |
340 KB |
Output is correct |
77 |
Correct |
1 ms |
340 KB |
Output is correct |
78 |
Correct |
0 ms |
340 KB |
Output is correct |
79 |
Correct |
1 ms |
284 KB |
Output is correct |
80 |
Correct |
0 ms |
340 KB |
Output is correct |
81 |
Correct |
1 ms |
344 KB |
Output is correct |
82 |
Correct |
0 ms |
340 KB |
Output is correct |
83 |
Correct |
1 ms |
340 KB |
Output is correct |
84 |
Correct |
1 ms |
292 KB |
Output is correct |
85 |
Correct |
0 ms |
340 KB |
Output is correct |
86 |
Correct |
1 ms |
344 KB |
Output is correct |
87 |
Correct |
2 ms |
980 KB |
Output is correct |
88 |
Correct |
2 ms |
1072 KB |
Output is correct |
89 |
Correct |
2 ms |
936 KB |
Output is correct |
90 |
Correct |
2 ms |
936 KB |
Output is correct |
91 |
Correct |
2 ms |
980 KB |
Output is correct |
92 |
Correct |
2 ms |
852 KB |
Output is correct |
93 |
Correct |
2 ms |
1108 KB |
Output is correct |
94 |
Correct |
2 ms |
980 KB |
Output is correct |
95 |
Correct |
2 ms |
936 KB |
Output is correct |
96 |
Correct |
3 ms |
1236 KB |
Output is correct |
97 |
Correct |
2 ms |
1108 KB |
Output is correct |
98 |
Correct |
2 ms |
980 KB |
Output is correct |
99 |
Correct |
2 ms |
936 KB |
Output is correct |
100 |
Correct |
2 ms |
860 KB |
Output is correct |
101 |
Correct |
3 ms |
1080 KB |
Output is correct |
102 |
Correct |
2 ms |
960 KB |
Output is correct |
103 |
Correct |
3 ms |
1248 KB |
Output is correct |
104 |
Correct |
3 ms |
1064 KB |
Output is correct |
105 |
Correct |
2 ms |
980 KB |
Output is correct |
106 |
Correct |
3 ms |
1076 KB |
Output is correct |
107 |
Correct |
2 ms |
1088 KB |
Output is correct |
108 |
Correct |
2 ms |
980 KB |
Output is correct |
109 |
Correct |
2 ms |
972 KB |
Output is correct |
110 |
Correct |
1 ms |
864 KB |
Output is correct |
111 |
Correct |
146 ms |
82256 KB |
Output is correct |
112 |
Correct |
136 ms |
78248 KB |
Output is correct |
113 |
Correct |
114 ms |
77148 KB |
Output is correct |
114 |
Correct |
100 ms |
72748 KB |
Output is correct |
115 |
Correct |
153 ms |
79988 KB |
Output is correct |
116 |
Correct |
141 ms |
71492 KB |
Output is correct |
117 |
Correct |
570 ms |
119844 KB |
Output is correct |
118 |
Correct |
307 ms |
98984 KB |
Output is correct |
119 |
Correct |
260 ms |
91404 KB |
Output is correct |
120 |
Correct |
190 ms |
78400 KB |
Output is correct |
121 |
Correct |
139 ms |
67320 KB |
Output is correct |
122 |
Correct |
503 ms |
127924 KB |
Output is correct |
123 |
Correct |
351 ms |
113628 KB |
Output is correct |
124 |
Correct |
270 ms |
93000 KB |
Output is correct |
125 |
Correct |
223 ms |
81400 KB |
Output is correct |
126 |
Correct |
168 ms |
67692 KB |
Output is correct |
127 |
Correct |
115 ms |
67524 KB |
Output is correct |
128 |
Correct |
121 ms |
68048 KB |
Output is correct |
129 |
Correct |
113 ms |
62936 KB |
Output is correct |
130 |
Correct |
105 ms |
62096 KB |
Output is correct |
131 |
Correct |
107 ms |
62196 KB |
Output is correct |
132 |
Correct |
106 ms |
62152 KB |
Output is correct |
133 |
Correct |
108 ms |
61920 KB |
Output is correct |
134 |
Correct |
108 ms |
61752 KB |
Output is correct |
135 |
Correct |
162 ms |
74448 KB |
Output is correct |
136 |
Correct |
134 ms |
68524 KB |
Output is correct |
137 |
Correct |
170 ms |
82840 KB |
Output is correct |
138 |
Correct |
135 ms |
73496 KB |
Output is correct |
139 |
Correct |
522 ms |
121200 KB |
Output is correct |
140 |
Correct |
318 ms |
105524 KB |
Output is correct |
141 |
Correct |
261 ms |
92044 KB |
Output is correct |
142 |
Correct |
219 ms |
79844 KB |
Output is correct |
143 |
Correct |
146 ms |
67876 KB |
Output is correct |
144 |
Correct |
474 ms |
114936 KB |
Output is correct |
145 |
Correct |
324 ms |
105868 KB |
Output is correct |
146 |
Correct |
257 ms |
92872 KB |
Output is correct |
147 |
Correct |
211 ms |
80576 KB |
Output is correct |
148 |
Correct |
152 ms |
66472 KB |
Output is correct |
149 |
Correct |
118 ms |
68084 KB |
Output is correct |
150 |
Correct |
135 ms |
68268 KB |
Output is correct |
151 |
Correct |
119 ms |
63672 KB |
Output is correct |
152 |
Correct |
116 ms |
63264 KB |
Output is correct |
153 |
Correct |
116 ms |
63076 KB |
Output is correct |
154 |
Correct |
112 ms |
62392 KB |
Output is correct |
155 |
Correct |
131 ms |
63136 KB |
Output is correct |
156 |
Correct |
110 ms |
62788 KB |
Output is correct |
157 |
Correct |
152 ms |
75436 KB |
Output is correct |
158 |
Correct |
121 ms |
69348 KB |
Output is correct |