/* https://oj.uz/submission/841403 (model_code) */
#include "beechtree.h"
#include <cstdlib>
#include <vector>
using namespace std;
typedef vector<int> vi;
const int N = 200000, M = 200000, LN = 18, N_ = N * (LN + 1) + 1, MD = 0x7fffffff, X = 123456789; /* LN = ceil(log2(N)) */
int n;
int *ej[N], eo[N], pp[N], cc[N], sz[N];
int min_(int i, int j) { return sz[i] < sz[j] ? i : j; }
int max_(int i, int j) { return sz[i] > sz[j] ? i : j; }
void append(int i, int j) {
int o = eo[i]++;
if (o >= 2 && (o & o - 1) == 0)
ej[i] = (int *) realloc(ej[i], o * 2 * sizeof *ej[i]);
ej[i][o] = j;
}
long long *ek[M]; int *ev[M], eo_[M];
int hash_(long long k) {
return (k / MD * X + k % MD) % MD * X % MD % M;
}
int add(long long k, int v) {
int h = hash_(k);
for (int o = eo_[h]; o--; )
if (ek[h][o] == k)
return 0;
int o = eo_[h]++;
if (o >= 2 && (o & o - 1) == 0) {
ek[h] = (long long *) realloc(ek[h], o * 2 * sizeof *ek[h]);
ev[h] = (int *) realloc(ev[h], o * 2 * sizeof *ev[h]);
}
ek[h][o] = k, ev[h][o] = v;
return 1;
}
int get(long long k) {
int h = hash_(k);
for (int o = eo_[h]; o--; )
if (ek[h][o] == k)
return ev[h][o];
return -1;
}
int contained(int i1, int i2) {
for (int o = eo[i1]; o--; ) {
int j1 = ej[i1][o], j2 = get((long long) i2 * M + cc[j1]);
if (j2 == -1 || sz[j1] > sz[j2])
return 0;
}
return 1;
}
int ll[N_], rr[N_], mn[N_], mx[N_];
int node(int l, int r, int s, int i) {
static int _ = 1;
int t_ = _++;
mn[t_] = mx[t_] = i;
if (r - l > 1) {
int m = (l + r) / 2;
if (s < m)
ll[t_] = node(l, m, s, i);
else
rr[t_] = node(m, r, s, i);
}
return t_;
}
int incr, i_, type;
int merge(int t1, int t2, int l, int r) {
if (t1 == 0 && t2 == 0)
return 0;
if (t1 == 0) {
if (i_ != -1 && type != 1 && !contained(i_, mn[t2]))
incr = 0;
i_ = mx[t2], type = 1;
return t2;
}
if (t2 == 0) {
if (i_ != -1 && type != 2 && !contained(i_, mn[t1]))
incr = 0;
i_ = mx[t1], type = 2;
return t1;
}
if (r - l == 1) {
if (!contained(mn[t1], mn[t2]))
incr = 0;
i_ = mx[t1], type = 1;
return t1;
}
int m = (l + r) / 2;
ll[t1] = merge(ll[t1], ll[t2], l, m), rr[t1] = merge(rr[t1], rr[t2], m, r);
mn[t1] = min_(mn[t1], mn[t2]), mx[t1] = max_(mx[t1], mx[t2]);
return t1;
}
vi good; int tt[N];
void dfs(int i) {
sz[i] = 1;
for (int o = eo[i]; o--; ) {
int j = ej[i][o];
dfs(j);
sz[i] += sz[j];
}
if (!good[i])
return;
tt[i] = node(0, n, sz[i] - 1, i);
for (int o = eo[i]; o--; ) {
int j = ej[i][o];
if (!good[j]) {
good[i] = 0;
return;
}
incr = 1, i_ = -1, type = -1, tt[i] = merge(tt[i], tt[j], 0, n);
if (!incr) {
good[i] = 0;
return;
}
}
}
vi beechtree(int n_, int m, vi pp_, vi cc_) {
n = n_;
for (int i = 0; i < n; i++)
pp[i] = pp_[i], cc[i] = cc_[i] - 1;
for (int i = 0; i < n; i++)
ej[i] = (int *) malloc(2 * sizeof *ej[i]);
for (int i = 1; i < n; i++)
append(pp[i], i);
good.clear(); good.resize(n, 1);
for (int h = 0; h < M; h++) {
ek[h] = (long long *) malloc(2 * sizeof *ek[h]);
ev[h] = (int *) malloc(2 * sizeof *ev[h]);
}
for (int i = 1; i < n; i++)
if (!add((long long) pp[i] * M + cc[i], i))
good[pp[i]] = 0;
dfs(0);
return good;
}
Compilation message
beechtree.cpp: In function 'void append(int, int)':
beechtree.cpp:21:23: warning: suggest parentheses around '-' in operand of '&' [-Wparentheses]
21 | if (o >= 2 && (o & o - 1) == 0)
| ~~^~~
beechtree.cpp: In function 'int add(long long int, int)':
beechtree.cpp:38:23: warning: suggest parentheses around '-' in operand of '&' [-Wparentheses]
38 | if (o >= 2 && (o & o - 1) == 0) {
| ~~^~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
25176 KB |
Output is correct |
2 |
Correct |
11 ms |
27228 KB |
Output is correct |
3 |
Correct |
11 ms |
27140 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
27228 KB |
Output is correct |
2 |
Correct |
11 ms |
27228 KB |
Output is correct |
3 |
Correct |
11 ms |
27228 KB |
Output is correct |
4 |
Correct |
12 ms |
27180 KB |
Output is correct |
5 |
Correct |
11 ms |
27228 KB |
Output is correct |
6 |
Correct |
11 ms |
27228 KB |
Output is correct |
7 |
Correct |
11 ms |
25180 KB |
Output is correct |
8 |
Correct |
11 ms |
27228 KB |
Output is correct |
9 |
Correct |
11 ms |
27092 KB |
Output is correct |
10 |
Correct |
13 ms |
27224 KB |
Output is correct |
11 |
Correct |
11 ms |
27228 KB |
Output is correct |
12 |
Correct |
11 ms |
27228 KB |
Output is correct |
13 |
Correct |
11 ms |
27228 KB |
Output is correct |
14 |
Correct |
11 ms |
27228 KB |
Output is correct |
15 |
Correct |
12 ms |
27228 KB |
Output is correct |
16 |
Correct |
11 ms |
27228 KB |
Output is correct |
17 |
Correct |
12 ms |
27224 KB |
Output is correct |
18 |
Correct |
11 ms |
27228 KB |
Output is correct |
19 |
Correct |
11 ms |
27228 KB |
Output is correct |
20 |
Correct |
11 ms |
27228 KB |
Output is correct |
21 |
Correct |
12 ms |
27228 KB |
Output is correct |
22 |
Correct |
12 ms |
27228 KB |
Output is correct |
23 |
Correct |
11 ms |
27228 KB |
Output is correct |
24 |
Correct |
11 ms |
27092 KB |
Output is correct |
25 |
Correct |
11 ms |
27228 KB |
Output is correct |
26 |
Correct |
11 ms |
27224 KB |
Output is correct |
27 |
Correct |
11 ms |
27228 KB |
Output is correct |
28 |
Correct |
11 ms |
27292 KB |
Output is correct |
29 |
Correct |
12 ms |
27224 KB |
Output is correct |
30 |
Correct |
13 ms |
27224 KB |
Output is correct |
31 |
Correct |
11 ms |
27288 KB |
Output is correct |
32 |
Correct |
11 ms |
27228 KB |
Output is correct |
33 |
Correct |
11 ms |
27228 KB |
Output is correct |
34 |
Correct |
11 ms |
27228 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
27228 KB |
Output is correct |
2 |
Correct |
11 ms |
27228 KB |
Output is correct |
3 |
Correct |
11 ms |
27228 KB |
Output is correct |
4 |
Correct |
12 ms |
27180 KB |
Output is correct |
5 |
Correct |
11 ms |
27228 KB |
Output is correct |
6 |
Correct |
11 ms |
27228 KB |
Output is correct |
7 |
Correct |
114 ms |
108960 KB |
Output is correct |
8 |
Correct |
106 ms |
108916 KB |
Output is correct |
9 |
Correct |
11 ms |
27480 KB |
Output is correct |
10 |
Correct |
11 ms |
27484 KB |
Output is correct |
11 |
Correct |
11 ms |
27484 KB |
Output is correct |
12 |
Correct |
11 ms |
27484 KB |
Output is correct |
13 |
Correct |
12 ms |
27736 KB |
Output is correct |
14 |
Correct |
12 ms |
27736 KB |
Output is correct |
15 |
Correct |
12 ms |
27912 KB |
Output is correct |
16 |
Correct |
12 ms |
27740 KB |
Output is correct |
17 |
Correct |
186 ms |
108128 KB |
Output is correct |
18 |
Correct |
155 ms |
108072 KB |
Output is correct |
19 |
Correct |
126 ms |
108880 KB |
Output is correct |
20 |
Correct |
106 ms |
108808 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
27480 KB |
Output is correct |
2 |
Correct |
12 ms |
27336 KB |
Output is correct |
3 |
Correct |
11 ms |
27224 KB |
Output is correct |
4 |
Correct |
11 ms |
27484 KB |
Output is correct |
5 |
Correct |
11 ms |
27432 KB |
Output is correct |
6 |
Correct |
12 ms |
27228 KB |
Output is correct |
7 |
Correct |
11 ms |
27312 KB |
Output is correct |
8 |
Correct |
15 ms |
27256 KB |
Output is correct |
9 |
Correct |
11 ms |
27224 KB |
Output is correct |
10 |
Correct |
12 ms |
27228 KB |
Output is correct |
11 |
Correct |
12 ms |
27484 KB |
Output is correct |
12 |
Correct |
13 ms |
27484 KB |
Output is correct |
13 |
Correct |
12 ms |
27484 KB |
Output is correct |
14 |
Correct |
13 ms |
27736 KB |
Output is correct |
15 |
Correct |
70 ms |
63492 KB |
Output is correct |
16 |
Correct |
65 ms |
60756 KB |
Output is correct |
17 |
Correct |
74 ms |
60884 KB |
Output is correct |
18 |
Correct |
74 ms |
61264 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
27228 KB |
Output is correct |
2 |
Correct |
11 ms |
27228 KB |
Output is correct |
3 |
Correct |
11 ms |
25180 KB |
Output is correct |
4 |
Correct |
11 ms |
27228 KB |
Output is correct |
5 |
Correct |
114 ms |
108960 KB |
Output is correct |
6 |
Correct |
106 ms |
108916 KB |
Output is correct |
7 |
Correct |
11 ms |
27484 KB |
Output is correct |
8 |
Correct |
11 ms |
27244 KB |
Output is correct |
9 |
Correct |
12 ms |
27736 KB |
Output is correct |
10 |
Correct |
12 ms |
27580 KB |
Output is correct |
11 |
Correct |
125 ms |
93264 KB |
Output is correct |
12 |
Correct |
106 ms |
91436 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
25176 KB |
Output is correct |
2 |
Correct |
11 ms |
27228 KB |
Output is correct |
3 |
Correct |
11 ms |
27140 KB |
Output is correct |
4 |
Correct |
11 ms |
27228 KB |
Output is correct |
5 |
Correct |
11 ms |
27228 KB |
Output is correct |
6 |
Correct |
11 ms |
27228 KB |
Output is correct |
7 |
Correct |
12 ms |
27180 KB |
Output is correct |
8 |
Correct |
11 ms |
27228 KB |
Output is correct |
9 |
Correct |
11 ms |
27228 KB |
Output is correct |
10 |
Correct |
11 ms |
25180 KB |
Output is correct |
11 |
Correct |
11 ms |
27228 KB |
Output is correct |
12 |
Correct |
11 ms |
27092 KB |
Output is correct |
13 |
Correct |
13 ms |
27224 KB |
Output is correct |
14 |
Correct |
11 ms |
27228 KB |
Output is correct |
15 |
Correct |
11 ms |
27228 KB |
Output is correct |
16 |
Correct |
11 ms |
27228 KB |
Output is correct |
17 |
Correct |
11 ms |
27228 KB |
Output is correct |
18 |
Correct |
12 ms |
27228 KB |
Output is correct |
19 |
Correct |
11 ms |
27228 KB |
Output is correct |
20 |
Correct |
12 ms |
27224 KB |
Output is correct |
21 |
Correct |
11 ms |
27228 KB |
Output is correct |
22 |
Correct |
11 ms |
27228 KB |
Output is correct |
23 |
Correct |
11 ms |
27228 KB |
Output is correct |
24 |
Correct |
12 ms |
27228 KB |
Output is correct |
25 |
Correct |
12 ms |
27228 KB |
Output is correct |
26 |
Correct |
11 ms |
27228 KB |
Output is correct |
27 |
Correct |
11 ms |
27092 KB |
Output is correct |
28 |
Correct |
11 ms |
27228 KB |
Output is correct |
29 |
Correct |
11 ms |
27224 KB |
Output is correct |
30 |
Correct |
11 ms |
27228 KB |
Output is correct |
31 |
Correct |
11 ms |
27292 KB |
Output is correct |
32 |
Correct |
12 ms |
27224 KB |
Output is correct |
33 |
Correct |
13 ms |
27224 KB |
Output is correct |
34 |
Correct |
11 ms |
27288 KB |
Output is correct |
35 |
Correct |
11 ms |
27228 KB |
Output is correct |
36 |
Correct |
11 ms |
27228 KB |
Output is correct |
37 |
Correct |
11 ms |
27228 KB |
Output is correct |
38 |
Correct |
11 ms |
27480 KB |
Output is correct |
39 |
Correct |
11 ms |
27484 KB |
Output is correct |
40 |
Correct |
11 ms |
27484 KB |
Output is correct |
41 |
Correct |
11 ms |
27484 KB |
Output is correct |
42 |
Correct |
13 ms |
27480 KB |
Output is correct |
43 |
Correct |
12 ms |
27336 KB |
Output is correct |
44 |
Correct |
11 ms |
27224 KB |
Output is correct |
45 |
Correct |
11 ms |
27484 KB |
Output is correct |
46 |
Correct |
11 ms |
27432 KB |
Output is correct |
47 |
Correct |
12 ms |
27228 KB |
Output is correct |
48 |
Correct |
11 ms |
27312 KB |
Output is correct |
49 |
Correct |
15 ms |
27256 KB |
Output is correct |
50 |
Correct |
11 ms |
27224 KB |
Output is correct |
51 |
Correct |
12 ms |
27228 KB |
Output is correct |
52 |
Correct |
11 ms |
27484 KB |
Output is correct |
53 |
Correct |
11 ms |
27244 KB |
Output is correct |
54 |
Correct |
11 ms |
27484 KB |
Output is correct |
55 |
Correct |
11 ms |
27484 KB |
Output is correct |
56 |
Correct |
11 ms |
27228 KB |
Output is correct |
57 |
Correct |
11 ms |
27320 KB |
Output is correct |
58 |
Correct |
11 ms |
27468 KB |
Output is correct |
59 |
Correct |
12 ms |
27480 KB |
Output is correct |
60 |
Correct |
12 ms |
27484 KB |
Output is correct |
61 |
Correct |
11 ms |
27484 KB |
Output is correct |
62 |
Correct |
11 ms |
27444 KB |
Output is correct |
63 |
Correct |
11 ms |
27484 KB |
Output is correct |
64 |
Correct |
11 ms |
27444 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
27228 KB |
Output is correct |
2 |
Correct |
11 ms |
27228 KB |
Output is correct |
3 |
Correct |
11 ms |
25180 KB |
Output is correct |
4 |
Correct |
11 ms |
27228 KB |
Output is correct |
5 |
Correct |
11 ms |
27092 KB |
Output is correct |
6 |
Correct |
13 ms |
27224 KB |
Output is correct |
7 |
Correct |
11 ms |
27228 KB |
Output is correct |
8 |
Correct |
11 ms |
27228 KB |
Output is correct |
9 |
Correct |
11 ms |
27228 KB |
Output is correct |
10 |
Correct |
11 ms |
27228 KB |
Output is correct |
11 |
Correct |
12 ms |
27228 KB |
Output is correct |
12 |
Correct |
11 ms |
27228 KB |
Output is correct |
13 |
Correct |
12 ms |
27224 KB |
Output is correct |
14 |
Correct |
11 ms |
27228 KB |
Output is correct |
15 |
Correct |
11 ms |
27228 KB |
Output is correct |
16 |
Correct |
11 ms |
27228 KB |
Output is correct |
17 |
Correct |
12 ms |
27228 KB |
Output is correct |
18 |
Correct |
12 ms |
27228 KB |
Output is correct |
19 |
Correct |
11 ms |
27228 KB |
Output is correct |
20 |
Correct |
11 ms |
27092 KB |
Output is correct |
21 |
Correct |
11 ms |
27228 KB |
Output is correct |
22 |
Correct |
11 ms |
27224 KB |
Output is correct |
23 |
Correct |
11 ms |
27228 KB |
Output is correct |
24 |
Correct |
11 ms |
27292 KB |
Output is correct |
25 |
Correct |
12 ms |
27736 KB |
Output is correct |
26 |
Correct |
13 ms |
27740 KB |
Output is correct |
27 |
Correct |
12 ms |
27848 KB |
Output is correct |
28 |
Correct |
12 ms |
27740 KB |
Output is correct |
29 |
Correct |
14 ms |
27876 KB |
Output is correct |
30 |
Correct |
12 ms |
27740 KB |
Output is correct |
31 |
Correct |
13 ms |
27740 KB |
Output is correct |
32 |
Correct |
13 ms |
27680 KB |
Output is correct |
33 |
Correct |
13 ms |
27736 KB |
Output is correct |
34 |
Correct |
12 ms |
27740 KB |
Output is correct |
35 |
Correct |
12 ms |
27740 KB |
Output is correct |
36 |
Correct |
12 ms |
27736 KB |
Output is correct |
37 |
Correct |
13 ms |
27740 KB |
Output is correct |
38 |
Correct |
13 ms |
27740 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
25176 KB |
Output is correct |
2 |
Correct |
11 ms |
27228 KB |
Output is correct |
3 |
Correct |
11 ms |
27140 KB |
Output is correct |
4 |
Correct |
11 ms |
27228 KB |
Output is correct |
5 |
Correct |
11 ms |
27228 KB |
Output is correct |
6 |
Correct |
11 ms |
27228 KB |
Output is correct |
7 |
Correct |
12 ms |
27180 KB |
Output is correct |
8 |
Correct |
11 ms |
27228 KB |
Output is correct |
9 |
Correct |
11 ms |
27228 KB |
Output is correct |
10 |
Correct |
11 ms |
25180 KB |
Output is correct |
11 |
Correct |
11 ms |
27228 KB |
Output is correct |
12 |
Correct |
11 ms |
27092 KB |
Output is correct |
13 |
Correct |
13 ms |
27224 KB |
Output is correct |
14 |
Correct |
11 ms |
27228 KB |
Output is correct |
15 |
Correct |
11 ms |
27228 KB |
Output is correct |
16 |
Correct |
11 ms |
27228 KB |
Output is correct |
17 |
Correct |
11 ms |
27228 KB |
Output is correct |
18 |
Correct |
12 ms |
27228 KB |
Output is correct |
19 |
Correct |
11 ms |
27228 KB |
Output is correct |
20 |
Correct |
12 ms |
27224 KB |
Output is correct |
21 |
Correct |
11 ms |
27228 KB |
Output is correct |
22 |
Correct |
11 ms |
27228 KB |
Output is correct |
23 |
Correct |
11 ms |
27228 KB |
Output is correct |
24 |
Correct |
12 ms |
27228 KB |
Output is correct |
25 |
Correct |
12 ms |
27228 KB |
Output is correct |
26 |
Correct |
11 ms |
27228 KB |
Output is correct |
27 |
Correct |
11 ms |
27092 KB |
Output is correct |
28 |
Correct |
11 ms |
27228 KB |
Output is correct |
29 |
Correct |
11 ms |
27224 KB |
Output is correct |
30 |
Correct |
11 ms |
27228 KB |
Output is correct |
31 |
Correct |
11 ms |
27292 KB |
Output is correct |
32 |
Correct |
12 ms |
27224 KB |
Output is correct |
33 |
Correct |
13 ms |
27224 KB |
Output is correct |
34 |
Correct |
11 ms |
27288 KB |
Output is correct |
35 |
Correct |
11 ms |
27228 KB |
Output is correct |
36 |
Correct |
11 ms |
27228 KB |
Output is correct |
37 |
Correct |
11 ms |
27228 KB |
Output is correct |
38 |
Correct |
11 ms |
27480 KB |
Output is correct |
39 |
Correct |
11 ms |
27484 KB |
Output is correct |
40 |
Correct |
11 ms |
27484 KB |
Output is correct |
41 |
Correct |
11 ms |
27484 KB |
Output is correct |
42 |
Correct |
12 ms |
27736 KB |
Output is correct |
43 |
Correct |
12 ms |
27736 KB |
Output is correct |
44 |
Correct |
12 ms |
27912 KB |
Output is correct |
45 |
Correct |
12 ms |
27740 KB |
Output is correct |
46 |
Correct |
13 ms |
27480 KB |
Output is correct |
47 |
Correct |
12 ms |
27336 KB |
Output is correct |
48 |
Correct |
11 ms |
27224 KB |
Output is correct |
49 |
Correct |
11 ms |
27484 KB |
Output is correct |
50 |
Correct |
11 ms |
27432 KB |
Output is correct |
51 |
Correct |
12 ms |
27228 KB |
Output is correct |
52 |
Correct |
11 ms |
27312 KB |
Output is correct |
53 |
Correct |
15 ms |
27256 KB |
Output is correct |
54 |
Correct |
11 ms |
27224 KB |
Output is correct |
55 |
Correct |
12 ms |
27228 KB |
Output is correct |
56 |
Correct |
12 ms |
27484 KB |
Output is correct |
57 |
Correct |
13 ms |
27484 KB |
Output is correct |
58 |
Correct |
12 ms |
27484 KB |
Output is correct |
59 |
Correct |
13 ms |
27736 KB |
Output is correct |
60 |
Correct |
11 ms |
27484 KB |
Output is correct |
61 |
Correct |
11 ms |
27244 KB |
Output is correct |
62 |
Correct |
12 ms |
27736 KB |
Output is correct |
63 |
Correct |
12 ms |
27580 KB |
Output is correct |
64 |
Correct |
11 ms |
27484 KB |
Output is correct |
65 |
Correct |
11 ms |
27484 KB |
Output is correct |
66 |
Correct |
11 ms |
27228 KB |
Output is correct |
67 |
Correct |
11 ms |
27320 KB |
Output is correct |
68 |
Correct |
11 ms |
27468 KB |
Output is correct |
69 |
Correct |
12 ms |
27480 KB |
Output is correct |
70 |
Correct |
12 ms |
27484 KB |
Output is correct |
71 |
Correct |
11 ms |
27484 KB |
Output is correct |
72 |
Correct |
11 ms |
27444 KB |
Output is correct |
73 |
Correct |
11 ms |
27484 KB |
Output is correct |
74 |
Correct |
11 ms |
27444 KB |
Output is correct |
75 |
Correct |
12 ms |
27736 KB |
Output is correct |
76 |
Correct |
13 ms |
27740 KB |
Output is correct |
77 |
Correct |
12 ms |
27848 KB |
Output is correct |
78 |
Correct |
12 ms |
27740 KB |
Output is correct |
79 |
Correct |
14 ms |
27876 KB |
Output is correct |
80 |
Correct |
12 ms |
27740 KB |
Output is correct |
81 |
Correct |
13 ms |
27740 KB |
Output is correct |
82 |
Correct |
13 ms |
27680 KB |
Output is correct |
83 |
Correct |
13 ms |
27736 KB |
Output is correct |
84 |
Correct |
12 ms |
27740 KB |
Output is correct |
85 |
Correct |
12 ms |
27740 KB |
Output is correct |
86 |
Correct |
12 ms |
27736 KB |
Output is correct |
87 |
Correct |
13 ms |
27740 KB |
Output is correct |
88 |
Correct |
13 ms |
27740 KB |
Output is correct |
89 |
Correct |
13 ms |
27848 KB |
Output is correct |
90 |
Correct |
12 ms |
27740 KB |
Output is correct |
91 |
Correct |
13 ms |
27740 KB |
Output is correct |
92 |
Correct |
18 ms |
27728 KB |
Output is correct |
93 |
Correct |
12 ms |
27740 KB |
Output is correct |
94 |
Correct |
12 ms |
27740 KB |
Output is correct |
95 |
Correct |
13 ms |
27740 KB |
Output is correct |
96 |
Correct |
12 ms |
27740 KB |
Output is correct |
97 |
Correct |
13 ms |
27992 KB |
Output is correct |
98 |
Correct |
13 ms |
27740 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
27228 KB |
Output is correct |
2 |
Correct |
11 ms |
27228 KB |
Output is correct |
3 |
Correct |
11 ms |
25180 KB |
Output is correct |
4 |
Correct |
11 ms |
27228 KB |
Output is correct |
5 |
Correct |
11 ms |
27092 KB |
Output is correct |
6 |
Correct |
13 ms |
27224 KB |
Output is correct |
7 |
Correct |
11 ms |
27228 KB |
Output is correct |
8 |
Correct |
11 ms |
27228 KB |
Output is correct |
9 |
Correct |
11 ms |
27228 KB |
Output is correct |
10 |
Correct |
11 ms |
27228 KB |
Output is correct |
11 |
Correct |
12 ms |
27228 KB |
Output is correct |
12 |
Correct |
11 ms |
27228 KB |
Output is correct |
13 |
Correct |
12 ms |
27224 KB |
Output is correct |
14 |
Correct |
11 ms |
27228 KB |
Output is correct |
15 |
Correct |
11 ms |
27228 KB |
Output is correct |
16 |
Correct |
11 ms |
27228 KB |
Output is correct |
17 |
Correct |
12 ms |
27228 KB |
Output is correct |
18 |
Correct |
12 ms |
27228 KB |
Output is correct |
19 |
Correct |
11 ms |
27228 KB |
Output is correct |
20 |
Correct |
11 ms |
27092 KB |
Output is correct |
21 |
Correct |
11 ms |
27228 KB |
Output is correct |
22 |
Correct |
11 ms |
27224 KB |
Output is correct |
23 |
Correct |
11 ms |
27228 KB |
Output is correct |
24 |
Correct |
11 ms |
27292 KB |
Output is correct |
25 |
Correct |
12 ms |
27736 KB |
Output is correct |
26 |
Correct |
13 ms |
27740 KB |
Output is correct |
27 |
Correct |
12 ms |
27848 KB |
Output is correct |
28 |
Correct |
12 ms |
27740 KB |
Output is correct |
29 |
Correct |
14 ms |
27876 KB |
Output is correct |
30 |
Correct |
12 ms |
27740 KB |
Output is correct |
31 |
Correct |
13 ms |
27740 KB |
Output is correct |
32 |
Correct |
13 ms |
27680 KB |
Output is correct |
33 |
Correct |
13 ms |
27736 KB |
Output is correct |
34 |
Correct |
12 ms |
27740 KB |
Output is correct |
35 |
Correct |
12 ms |
27740 KB |
Output is correct |
36 |
Correct |
12 ms |
27736 KB |
Output is correct |
37 |
Correct |
13 ms |
27740 KB |
Output is correct |
38 |
Correct |
13 ms |
27740 KB |
Output is correct |
39 |
Correct |
188 ms |
108312 KB |
Output is correct |
40 |
Correct |
147 ms |
107980 KB |
Output is correct |
41 |
Correct |
142 ms |
108624 KB |
Output is correct |
42 |
Correct |
121 ms |
108372 KB |
Output is correct |
43 |
Correct |
198 ms |
102352 KB |
Output is correct |
44 |
Correct |
178 ms |
94800 KB |
Output is correct |
45 |
Correct |
226 ms |
93268 KB |
Output is correct |
46 |
Correct |
179 ms |
92624 KB |
Output is correct |
47 |
Correct |
167 ms |
92908 KB |
Output is correct |
48 |
Correct |
163 ms |
92372 KB |
Output is correct |
49 |
Correct |
139 ms |
91344 KB |
Output is correct |
50 |
Correct |
183 ms |
92668 KB |
Output is correct |
51 |
Correct |
161 ms |
92192 KB |
Output is correct |
52 |
Correct |
148 ms |
92244 KB |
Output is correct |
53 |
Correct |
144 ms |
91988 KB |
Output is correct |
54 |
Correct |
131 ms |
90448 KB |
Output is correct |
55 |
Correct |
123 ms |
98132 KB |
Output is correct |
56 |
Correct |
125 ms |
98396 KB |
Output is correct |
57 |
Correct |
125 ms |
93396 KB |
Output is correct |
58 |
Correct |
122 ms |
92752 KB |
Output is correct |
59 |
Correct |
123 ms |
92432 KB |
Output is correct |
60 |
Correct |
122 ms |
92604 KB |
Output is correct |
61 |
Correct |
126 ms |
92532 KB |
Output is correct |
62 |
Correct |
120 ms |
92260 KB |
Output is correct |
63 |
Correct |
206 ms |
96092 KB |
Output is correct |
64 |
Correct |
166 ms |
94568 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
25176 KB |
Output is correct |
2 |
Correct |
11 ms |
27228 KB |
Output is correct |
3 |
Correct |
11 ms |
27140 KB |
Output is correct |
4 |
Correct |
11 ms |
27228 KB |
Output is correct |
5 |
Correct |
11 ms |
27228 KB |
Output is correct |
6 |
Correct |
11 ms |
27228 KB |
Output is correct |
7 |
Correct |
12 ms |
27180 KB |
Output is correct |
8 |
Correct |
11 ms |
27228 KB |
Output is correct |
9 |
Correct |
11 ms |
27228 KB |
Output is correct |
10 |
Correct |
11 ms |
25180 KB |
Output is correct |
11 |
Correct |
11 ms |
27228 KB |
Output is correct |
12 |
Correct |
11 ms |
27092 KB |
Output is correct |
13 |
Correct |
13 ms |
27224 KB |
Output is correct |
14 |
Correct |
11 ms |
27228 KB |
Output is correct |
15 |
Correct |
11 ms |
27228 KB |
Output is correct |
16 |
Correct |
11 ms |
27228 KB |
Output is correct |
17 |
Correct |
11 ms |
27228 KB |
Output is correct |
18 |
Correct |
12 ms |
27228 KB |
Output is correct |
19 |
Correct |
11 ms |
27228 KB |
Output is correct |
20 |
Correct |
12 ms |
27224 KB |
Output is correct |
21 |
Correct |
11 ms |
27228 KB |
Output is correct |
22 |
Correct |
11 ms |
27228 KB |
Output is correct |
23 |
Correct |
11 ms |
27228 KB |
Output is correct |
24 |
Correct |
12 ms |
27228 KB |
Output is correct |
25 |
Correct |
12 ms |
27228 KB |
Output is correct |
26 |
Correct |
11 ms |
27228 KB |
Output is correct |
27 |
Correct |
11 ms |
27092 KB |
Output is correct |
28 |
Correct |
11 ms |
27228 KB |
Output is correct |
29 |
Correct |
11 ms |
27224 KB |
Output is correct |
30 |
Correct |
11 ms |
27228 KB |
Output is correct |
31 |
Correct |
11 ms |
27292 KB |
Output is correct |
32 |
Correct |
12 ms |
27224 KB |
Output is correct |
33 |
Correct |
13 ms |
27224 KB |
Output is correct |
34 |
Correct |
11 ms |
27288 KB |
Output is correct |
35 |
Correct |
11 ms |
27228 KB |
Output is correct |
36 |
Correct |
11 ms |
27228 KB |
Output is correct |
37 |
Correct |
11 ms |
27228 KB |
Output is correct |
38 |
Correct |
114 ms |
108960 KB |
Output is correct |
39 |
Correct |
106 ms |
108916 KB |
Output is correct |
40 |
Correct |
11 ms |
27480 KB |
Output is correct |
41 |
Correct |
11 ms |
27484 KB |
Output is correct |
42 |
Correct |
11 ms |
27484 KB |
Output is correct |
43 |
Correct |
11 ms |
27484 KB |
Output is correct |
44 |
Correct |
12 ms |
27736 KB |
Output is correct |
45 |
Correct |
12 ms |
27736 KB |
Output is correct |
46 |
Correct |
12 ms |
27912 KB |
Output is correct |
47 |
Correct |
12 ms |
27740 KB |
Output is correct |
48 |
Correct |
186 ms |
108128 KB |
Output is correct |
49 |
Correct |
155 ms |
108072 KB |
Output is correct |
50 |
Correct |
126 ms |
108880 KB |
Output is correct |
51 |
Correct |
106 ms |
108808 KB |
Output is correct |
52 |
Correct |
13 ms |
27480 KB |
Output is correct |
53 |
Correct |
12 ms |
27336 KB |
Output is correct |
54 |
Correct |
11 ms |
27224 KB |
Output is correct |
55 |
Correct |
11 ms |
27484 KB |
Output is correct |
56 |
Correct |
11 ms |
27432 KB |
Output is correct |
57 |
Correct |
12 ms |
27228 KB |
Output is correct |
58 |
Correct |
11 ms |
27312 KB |
Output is correct |
59 |
Correct |
15 ms |
27256 KB |
Output is correct |
60 |
Correct |
11 ms |
27224 KB |
Output is correct |
61 |
Correct |
12 ms |
27228 KB |
Output is correct |
62 |
Correct |
12 ms |
27484 KB |
Output is correct |
63 |
Correct |
13 ms |
27484 KB |
Output is correct |
64 |
Correct |
12 ms |
27484 KB |
Output is correct |
65 |
Correct |
13 ms |
27736 KB |
Output is correct |
66 |
Correct |
70 ms |
63492 KB |
Output is correct |
67 |
Correct |
65 ms |
60756 KB |
Output is correct |
68 |
Correct |
74 ms |
60884 KB |
Output is correct |
69 |
Correct |
74 ms |
61264 KB |
Output is correct |
70 |
Correct |
11 ms |
27484 KB |
Output is correct |
71 |
Correct |
11 ms |
27244 KB |
Output is correct |
72 |
Correct |
12 ms |
27736 KB |
Output is correct |
73 |
Correct |
12 ms |
27580 KB |
Output is correct |
74 |
Correct |
125 ms |
93264 KB |
Output is correct |
75 |
Correct |
106 ms |
91436 KB |
Output is correct |
76 |
Correct |
11 ms |
27484 KB |
Output is correct |
77 |
Correct |
11 ms |
27484 KB |
Output is correct |
78 |
Correct |
11 ms |
27228 KB |
Output is correct |
79 |
Correct |
11 ms |
27320 KB |
Output is correct |
80 |
Correct |
11 ms |
27468 KB |
Output is correct |
81 |
Correct |
12 ms |
27480 KB |
Output is correct |
82 |
Correct |
12 ms |
27484 KB |
Output is correct |
83 |
Correct |
11 ms |
27484 KB |
Output is correct |
84 |
Correct |
11 ms |
27444 KB |
Output is correct |
85 |
Correct |
11 ms |
27484 KB |
Output is correct |
86 |
Correct |
11 ms |
27444 KB |
Output is correct |
87 |
Correct |
12 ms |
27736 KB |
Output is correct |
88 |
Correct |
13 ms |
27740 KB |
Output is correct |
89 |
Correct |
12 ms |
27848 KB |
Output is correct |
90 |
Correct |
12 ms |
27740 KB |
Output is correct |
91 |
Correct |
14 ms |
27876 KB |
Output is correct |
92 |
Correct |
12 ms |
27740 KB |
Output is correct |
93 |
Correct |
13 ms |
27740 KB |
Output is correct |
94 |
Correct |
13 ms |
27680 KB |
Output is correct |
95 |
Correct |
13 ms |
27736 KB |
Output is correct |
96 |
Correct |
12 ms |
27740 KB |
Output is correct |
97 |
Correct |
12 ms |
27740 KB |
Output is correct |
98 |
Correct |
12 ms |
27736 KB |
Output is correct |
99 |
Correct |
13 ms |
27740 KB |
Output is correct |
100 |
Correct |
13 ms |
27740 KB |
Output is correct |
101 |
Correct |
13 ms |
27848 KB |
Output is correct |
102 |
Correct |
12 ms |
27740 KB |
Output is correct |
103 |
Correct |
13 ms |
27740 KB |
Output is correct |
104 |
Correct |
18 ms |
27728 KB |
Output is correct |
105 |
Correct |
12 ms |
27740 KB |
Output is correct |
106 |
Correct |
12 ms |
27740 KB |
Output is correct |
107 |
Correct |
13 ms |
27740 KB |
Output is correct |
108 |
Correct |
12 ms |
27740 KB |
Output is correct |
109 |
Correct |
13 ms |
27992 KB |
Output is correct |
110 |
Correct |
13 ms |
27740 KB |
Output is correct |
111 |
Correct |
188 ms |
108312 KB |
Output is correct |
112 |
Correct |
147 ms |
107980 KB |
Output is correct |
113 |
Correct |
142 ms |
108624 KB |
Output is correct |
114 |
Correct |
121 ms |
108372 KB |
Output is correct |
115 |
Correct |
198 ms |
102352 KB |
Output is correct |
116 |
Correct |
178 ms |
94800 KB |
Output is correct |
117 |
Correct |
226 ms |
93268 KB |
Output is correct |
118 |
Correct |
179 ms |
92624 KB |
Output is correct |
119 |
Correct |
167 ms |
92908 KB |
Output is correct |
120 |
Correct |
163 ms |
92372 KB |
Output is correct |
121 |
Correct |
139 ms |
91344 KB |
Output is correct |
122 |
Correct |
183 ms |
92668 KB |
Output is correct |
123 |
Correct |
161 ms |
92192 KB |
Output is correct |
124 |
Correct |
148 ms |
92244 KB |
Output is correct |
125 |
Correct |
144 ms |
91988 KB |
Output is correct |
126 |
Correct |
131 ms |
90448 KB |
Output is correct |
127 |
Correct |
123 ms |
98132 KB |
Output is correct |
128 |
Correct |
125 ms |
98396 KB |
Output is correct |
129 |
Correct |
125 ms |
93396 KB |
Output is correct |
130 |
Correct |
122 ms |
92752 KB |
Output is correct |
131 |
Correct |
123 ms |
92432 KB |
Output is correct |
132 |
Correct |
122 ms |
92604 KB |
Output is correct |
133 |
Correct |
126 ms |
92532 KB |
Output is correct |
134 |
Correct |
120 ms |
92260 KB |
Output is correct |
135 |
Correct |
206 ms |
96092 KB |
Output is correct |
136 |
Correct |
166 ms |
94568 KB |
Output is correct |
137 |
Correct |
214 ms |
99348 KB |
Output is correct |
138 |
Correct |
182 ms |
95872 KB |
Output is correct |
139 |
Correct |
227 ms |
92772 KB |
Output is correct |
140 |
Correct |
185 ms |
93008 KB |
Output is correct |
141 |
Correct |
218 ms |
93264 KB |
Output is correct |
142 |
Correct |
167 ms |
92868 KB |
Output is correct |
143 |
Correct |
158 ms |
91692 KB |
Output is correct |
144 |
Correct |
174 ms |
93916 KB |
Output is correct |
145 |
Correct |
157 ms |
93008 KB |
Output is correct |
146 |
Correct |
156 ms |
92720 KB |
Output is correct |
147 |
Correct |
148 ms |
92628 KB |
Output is correct |
148 |
Correct |
148 ms |
90392 KB |
Output is correct |
149 |
Correct |
132 ms |
97996 KB |
Output is correct |
150 |
Correct |
126 ms |
97940 KB |
Output is correct |
151 |
Correct |
130 ms |
93092 KB |
Output is correct |
152 |
Correct |
129 ms |
92852 KB |
Output is correct |
153 |
Correct |
125 ms |
92620 KB |
Output is correct |
154 |
Correct |
144 ms |
92500 KB |
Output is correct |
155 |
Correct |
128 ms |
92448 KB |
Output is correct |
156 |
Correct |
132 ms |
92352 KB |
Output is correct |
157 |
Correct |
200 ms |
96356 KB |
Output is correct |
158 |
Correct |
163 ms |
94704 KB |
Output is correct |