/* upsolved after discussing with Benq */
#include "hieroglyphs.h"
#include <cstdlib>
#include <cstring>
#include <vector>
using namespace std;
typedef vector<int> vi;
const int N = 100000, M = 100000, A = 200000, INF = 0x3f3f3f3f;
int min(int a, int b) { return a < b ? a : b; }
int aa_[N], bb_[M], iia[N], jja[N], iib[M], jjb[M], iic[N], jjc[N], iic_[N], jjc_[N], nxt[N], n, m, n_, m_, l;
int *eia[A + 1], eoa[A + 1], *ejb[A + 1], eob[A + 1];
int hh[A + 1];
void append(int **ei, int *eo, int a, int i) {
int o = eo[a]++;
if (o >= 2 && (o & o - 1) == 0)
ei[a] = (int *) realloc(ei[a], o * 2 * sizeof *ei[a]);
ei[a][o] = i;
}
int prev(int **ei, int *eo, int a, int i) {
int lower = -1, upper = eo[a];
while (upper - lower > 1) {
int o = (lower + upper) / 2;
if (ei[a][o] < i)
lower = o;
else
upper = o;
}
return lower == -1 ? -1 : ei[a][lower];
}
int next(int **ei, int *eo, int a, int i) {
int lower = -1, upper = eo[a];
while (upper - lower > 1) {
int o = (lower + upper) / 2;
if (ei[a][o] > i)
upper = o;
else
lower = o;
}
return upper == eo[a] ? -1 : ei[a][upper];
}
int ft[N];
void update(int i, int n, int x) {
while (i < n) {
ft[i] = min(ft[i], x);
i |= i + 1;
}
}
int query(int i) {
int x = INF;
while (i >= 0) {
x = min(x, ft[i]);
i &= i + 1, i--;
}
return x;
}
vi ucs(vi aa, vi bb) {
n = aa.size(), m = bb.size();
for (int a = 0; a <= A; a++)
eia[a] = (int *) malloc(2 * sizeof *eia[a]);
for (int b = 0; b <= A; b++)
ejb[b] = (int *) malloc(2 * sizeof *ejb[b]);
for (int i = 0; i < n; i++)
append(eia, eoa, aa[i], i);
for (int j = 0; j < m; j++)
append(ejb, eob, bb[j], j);
for (int i = 0; i < n; i++) {
int a = aa[i];
if (eoa[a] <= eob[a])
aa_[n_++] = a;
}
for (int j = 0; j < m; j++) {
int b = bb[j];
if (eoa[b] > eob[b])
bb_[m_++] = b;
}
for (int i_ = 0, i = 0; i_ < n_; i_++) {
while (i < n && aa[i] != aa_[i_])
i++;
iia[i_] = i++;
}
for (int i_ = 0, j = 0; i_ < n_; i_++) {
while (j < m && bb[j] != aa_[i_])
j++;
if (j == m)
return vi({ -1 });
jja[i_] = j++;
}
for (int j_ = m_ - 1, i = n - 1; j_ >= 0; j_--) {
while (i >= 0 && aa[i] != bb_[j_])
i--;
if (i < 0)
return vi({ -1 });
iib[j_] = i--;
}
for (int j_ = m_ - 1, j = m - 1; j_ >= 0; j_--) {
while (j >= 0 && bb[j] != bb_[j_])
j--;
jjb[j_] = j--;
}
l = n_ + m_;
vi cc(l);
int h = 0, i_ = 0;
for (int j_ = 0; j_ < m_; j_++) {
while (i_ < n_ && iia[i_] < iib[j_] && jja[i_] < jjb[j_])
cc[h++] = aa_[i_++];
cc[h++] = bb_[j_];
}
while (i_ < n_)
cc[h++] = aa_[i_++];
for (int h = 0, i = 0; h < l; h++) {
while (i < n && aa[i] != cc[h])
i++;
if (i == n)
return vi({ -1 });
iic[h] = i++;
}
for (int h = 0, j = 0; h < l; h++) {
while (j < m && bb[j] != cc[h])
j++;
if (j == m)
return vi({ -1 });
jjc[h] = j++;
}
memset(hh, -1, (A + 1) * sizeof *hh);
memset(ft, 0x3f, l * sizeof *ft);
for (int h = 0; h < l; h++) {
int c = cc[h], i = hh[c] == -1 ? -1 : query(l - 1 - hh[c]);
hh[c] = h;
update(l - 1 - h, l, iic_[h] = next(eia, eoa, c, i));
}
memset(hh, -1, (A + 1) * sizeof *hh);
memset(ft, 0x3f, l * sizeof *ft);
for (int h = 0; h < l; h++) {
int c = cc[h], j = hh[c] == -1 ? -1 : query(l - 1 - hh[c]);
hh[c] = h;
update(l - 1 - h, l, jjc_[h] = next(ejb, eob, c, j));
}
memset(hh, -1, (A + 1) * sizeof *hh);
for (int h = l - 1; h >= 0; h--) {
int c = cc[h];
nxt[h] = hh[c], hh[c] = h;
}
memset(ft, 0x3f, n * sizeof *ft);
for (int c = 0; c <= A; c++) {
int h = hh[c];
if (h != -1) {
int i = prev(eia, eoa, c, iic[h]), j = prev(ejb, eob, c, jjc[h]);
if (i >= 0 && j >= 0)
update(n - 1 - i, n, -j);
}
}
for (int h = 0; h < l; h++) {
int c = cc[h], q = nxt[h], i, j;
if (q == -1)
i = eia[c][eoa[c] - 1], j = ejb[c][eob[c] - 1];
else
i = prev(eia, eoa, c, iic[q]), j = prev(ejb, eob, c, jjc[q]);
if (i >= 0 && j >= 0)
update(n - 1 - i, n, -j);
i = iic_[h], j = jjc[h];
if (-query(n - 2 - i) > j)
return vi({ -1 });
i = iic[h], j = jjc_[h];
if (-query(n - 2 - i) > j)
return vi({ -1 });
}
return cc;
}
Compilation message
hieroglyphs.cpp: In function 'void append(int**, int*, int, int)':
hieroglyphs.cpp:21:23: warning: suggest parentheses around '-' in operand of '&' [-Wparentheses]
21 | if (o >= 2 && (o & o - 1) == 0)
| ~~^~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
13 ms |
21588 KB |
Output is correct |
2 |
Correct |
13 ms |
19652 KB |
Output is correct |
3 |
Correct |
14 ms |
21588 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
13 ms |
21588 KB |
Output is correct |
2 |
Correct |
13 ms |
21076 KB |
Output is correct |
3 |
Correct |
18 ms |
21628 KB |
Output is correct |
4 |
Correct |
13 ms |
21000 KB |
Output is correct |
5 |
Correct |
53 ms |
25672 KB |
Output is correct |
6 |
Correct |
40 ms |
24624 KB |
Output is correct |
7 |
Correct |
35 ms |
24400 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
13 ms |
21588 KB |
Output is correct |
2 |
Correct |
13 ms |
21076 KB |
Output is correct |
3 |
Correct |
18 ms |
21628 KB |
Output is correct |
4 |
Correct |
13 ms |
21000 KB |
Output is correct |
5 |
Correct |
53 ms |
25672 KB |
Output is correct |
6 |
Correct |
40 ms |
24624 KB |
Output is correct |
7 |
Correct |
35 ms |
24400 KB |
Output is correct |
8 |
Correct |
55 ms |
25060 KB |
Output is correct |
9 |
Correct |
53 ms |
24908 KB |
Output is correct |
10 |
Correct |
63 ms |
25052 KB |
Output is correct |
11 |
Correct |
59 ms |
24940 KB |
Output is correct |
12 |
Correct |
54 ms |
24904 KB |
Output is correct |
13 |
Correct |
67 ms |
24904 KB |
Output is correct |
14 |
Correct |
57 ms |
24920 KB |
Output is correct |
15 |
Correct |
51 ms |
24912 KB |
Output is correct |
16 |
Correct |
53 ms |
25112 KB |
Output is correct |
17 |
Correct |
50 ms |
24904 KB |
Output is correct |
18 |
Correct |
17 ms |
21588 KB |
Output is correct |
19 |
Correct |
15 ms |
21588 KB |
Output is correct |
20 |
Correct |
16 ms |
21588 KB |
Output is correct |
21 |
Correct |
16 ms |
21844 KB |
Output is correct |
22 |
Correct |
34 ms |
23880 KB |
Output is correct |
23 |
Correct |
53 ms |
25260 KB |
Output is correct |
24 |
Correct |
43 ms |
25260 KB |
Output is correct |
25 |
Correct |
41 ms |
25128 KB |
Output is correct |
26 |
Correct |
35 ms |
24392 KB |
Output is correct |
27 |
Correct |
48 ms |
25124 KB |
Output is correct |
28 |
Correct |
50 ms |
24904 KB |
Output is correct |
29 |
Correct |
47 ms |
24912 KB |
Output is correct |
30 |
Correct |
45 ms |
24904 KB |
Output is correct |
31 |
Correct |
52 ms |
24928 KB |
Output is correct |
32 |
Correct |
44 ms |
24904 KB |
Output is correct |
33 |
Correct |
44 ms |
24908 KB |
Output is correct |
34 |
Correct |
43 ms |
24624 KB |
Output is correct |
35 |
Correct |
50 ms |
24916 KB |
Output is correct |
36 |
Correct |
48 ms |
25016 KB |
Output is correct |
37 |
Correct |
43 ms |
24904 KB |
Output is correct |
38 |
Correct |
50 ms |
25076 KB |
Output is correct |
39 |
Correct |
58 ms |
24904 KB |
Output is correct |
40 |
Correct |
44 ms |
25060 KB |
Output is correct |
41 |
Correct |
61 ms |
25052 KB |
Output is correct |
42 |
Correct |
56 ms |
25064 KB |
Output is correct |
43 |
Correct |
63 ms |
25084 KB |
Output is correct |
44 |
Correct |
62 ms |
24912 KB |
Output is correct |
45 |
Correct |
39 ms |
24988 KB |
Output is correct |
46 |
Correct |
45 ms |
24904 KB |
Output is correct |
47 |
Correct |
43 ms |
25028 KB |
Output is correct |
48 |
Correct |
64 ms |
25048 KB |
Output is correct |
49 |
Correct |
42 ms |
24904 KB |
Output is correct |
50 |
Correct |
50 ms |
24928 KB |
Output is correct |
51 |
Correct |
49 ms |
25128 KB |
Output is correct |
52 |
Correct |
42 ms |
24980 KB |
Output is correct |
53 |
Correct |
41 ms |
24912 KB |
Output is correct |
54 |
Correct |
44 ms |
25128 KB |
Output is correct |
55 |
Correct |
40 ms |
24904 KB |
Output is correct |
56 |
Correct |
61 ms |
25160 KB |
Output is correct |
57 |
Correct |
49 ms |
24904 KB |
Output is correct |
58 |
Correct |
45 ms |
24912 KB |
Output is correct |
59 |
Correct |
67 ms |
24904 KB |
Output is correct |
60 |
Correct |
45 ms |
24912 KB |
Output is correct |
61 |
Correct |
42 ms |
25128 KB |
Output is correct |
62 |
Correct |
39 ms |
25056 KB |
Output is correct |
63 |
Correct |
38 ms |
24952 KB |
Output is correct |
64 |
Correct |
40 ms |
25168 KB |
Output is correct |
65 |
Correct |
40 ms |
25124 KB |
Output is correct |
66 |
Correct |
47 ms |
24932 KB |
Output is correct |
67 |
Correct |
48 ms |
24912 KB |
Output is correct |
68 |
Correct |
39 ms |
24908 KB |
Output is correct |
69 |
Correct |
14 ms |
21588 KB |
Output is correct |
70 |
Correct |
14 ms |
21588 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
65 ms |
25888 KB |
Output is correct |
2 |
Correct |
67 ms |
25656 KB |
Output is correct |
3 |
Correct |
45 ms |
25428 KB |
Output is correct |
4 |
Correct |
45 ms |
25048 KB |
Output is correct |
5 |
Correct |
61 ms |
25464 KB |
Output is correct |
6 |
Correct |
24 ms |
23472 KB |
Output is correct |
7 |
Correct |
15 ms |
21588 KB |
Output is correct |
8 |
Correct |
17 ms |
21588 KB |
Output is correct |
9 |
Correct |
14 ms |
21804 KB |
Output is correct |
10 |
Correct |
22 ms |
21588 KB |
Output is correct |
11 |
Correct |
14 ms |
21692 KB |
Output is correct |
12 |
Correct |
13 ms |
21588 KB |
Output is correct |
13 |
Correct |
13 ms |
21608 KB |
Output is correct |
14 |
Correct |
13 ms |
21076 KB |
Output is correct |
15 |
Correct |
15 ms |
21076 KB |
Output is correct |
16 |
Correct |
61 ms |
25684 KB |
Output is correct |
17 |
Correct |
31 ms |
24648 KB |
Output is correct |
18 |
Correct |
46 ms |
24544 KB |
Output is correct |
19 |
Correct |
41 ms |
24432 KB |
Output is correct |
20 |
Correct |
62 ms |
25052 KB |
Output is correct |
21 |
Correct |
43 ms |
24976 KB |
Output is correct |
22 |
Correct |
31 ms |
24904 KB |
Output is correct |
23 |
Correct |
34 ms |
24652 KB |
Output is correct |
24 |
Correct |
63 ms |
25712 KB |
Output is correct |
25 |
Correct |
31 ms |
24412 KB |
Output is correct |
26 |
Correct |
67 ms |
25628 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
55 ms |
25060 KB |
Output is correct |
2 |
Correct |
53 ms |
24908 KB |
Output is correct |
3 |
Correct |
63 ms |
25052 KB |
Output is correct |
4 |
Correct |
59 ms |
24940 KB |
Output is correct |
5 |
Correct |
54 ms |
24904 KB |
Output is correct |
6 |
Correct |
67 ms |
24904 KB |
Output is correct |
7 |
Correct |
57 ms |
24920 KB |
Output is correct |
8 |
Correct |
51 ms |
24912 KB |
Output is correct |
9 |
Correct |
53 ms |
25112 KB |
Output is correct |
10 |
Correct |
50 ms |
24904 KB |
Output is correct |
11 |
Correct |
17 ms |
21588 KB |
Output is correct |
12 |
Correct |
15 ms |
21588 KB |
Output is correct |
13 |
Correct |
16 ms |
21588 KB |
Output is correct |
14 |
Correct |
16 ms |
21844 KB |
Output is correct |
15 |
Correct |
34 ms |
23880 KB |
Output is correct |
16 |
Correct |
53 ms |
25260 KB |
Output is correct |
17 |
Correct |
43 ms |
25260 KB |
Output is correct |
18 |
Correct |
41 ms |
25128 KB |
Output is correct |
19 |
Correct |
35 ms |
24392 KB |
Output is correct |
20 |
Correct |
65 ms |
25888 KB |
Output is correct |
21 |
Correct |
67 ms |
25656 KB |
Output is correct |
22 |
Correct |
45 ms |
25428 KB |
Output is correct |
23 |
Correct |
45 ms |
25048 KB |
Output is correct |
24 |
Correct |
61 ms |
25464 KB |
Output is correct |
25 |
Correct |
24 ms |
23472 KB |
Output is correct |
26 |
Correct |
16 ms |
21860 KB |
Output is correct |
27 |
Correct |
17 ms |
21848 KB |
Output is correct |
28 |
Correct |
17 ms |
21828 KB |
Output is correct |
29 |
Correct |
18 ms |
21776 KB |
Output is correct |
30 |
Correct |
24 ms |
21732 KB |
Output is correct |
31 |
Correct |
17 ms |
21856 KB |
Output is correct |
32 |
Correct |
26 ms |
21848 KB |
Output is correct |
33 |
Correct |
24 ms |
21856 KB |
Output is correct |
34 |
Correct |
25 ms |
23136 KB |
Output is correct |
35 |
Correct |
55 ms |
26480 KB |
Output is correct |
36 |
Correct |
76 ms |
26696 KB |
Output is correct |
37 |
Correct |
59 ms |
26952 KB |
Output is correct |
38 |
Correct |
80 ms |
26672 KB |
Output is correct |
39 |
Correct |
70 ms |
26736 KB |
Output is correct |
40 |
Correct |
66 ms |
25256 KB |
Output is correct |
41 |
Correct |
53 ms |
25160 KB |
Output is correct |
42 |
Correct |
33 ms |
25884 KB |
Output is correct |
43 |
Correct |
29 ms |
25968 KB |
Output is correct |
44 |
Correct |
32 ms |
25796 KB |
Output is correct |
45 |
Correct |
34 ms |
25760 KB |
Output is correct |
46 |
Correct |
56 ms |
24648 KB |
Output is correct |
47 |
Correct |
51 ms |
24464 KB |
Output is correct |
48 |
Correct |
56 ms |
24452 KB |
Output is correct |
49 |
Correct |
46 ms |
24764 KB |
Output is correct |
50 |
Correct |
48 ms |
24892 KB |
Output is correct |
51 |
Correct |
46 ms |
24784 KB |
Output is correct |
52 |
Correct |
52 ms |
26184 KB |
Output is correct |
53 |
Correct |
50 ms |
26136 KB |
Output is correct |
54 |
Correct |
53 ms |
26192 KB |
Output is correct |
55 |
Correct |
24 ms |
23980 KB |
Output is correct |
56 |
Correct |
77 ms |
26912 KB |
Output is correct |
57 |
Correct |
71 ms |
26348 KB |
Output is correct |
58 |
Correct |
69 ms |
26968 KB |
Output is correct |
59 |
Correct |
75 ms |
26704 KB |
Output is correct |
60 |
Correct |
65 ms |
26192 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
15 ms |
21588 KB |
Output is correct |
2 |
Correct |
17 ms |
21588 KB |
Output is correct |
3 |
Correct |
14 ms |
21804 KB |
Output is correct |
4 |
Correct |
22 ms |
21588 KB |
Output is correct |
5 |
Correct |
14 ms |
21692 KB |
Output is correct |
6 |
Correct |
13 ms |
21588 KB |
Output is correct |
7 |
Correct |
13 ms |
21608 KB |
Output is correct |
8 |
Correct |
13 ms |
21076 KB |
Output is correct |
9 |
Correct |
15 ms |
21076 KB |
Output is correct |
10 |
Correct |
16 ms |
21860 KB |
Output is correct |
11 |
Correct |
17 ms |
21848 KB |
Output is correct |
12 |
Correct |
17 ms |
21828 KB |
Output is correct |
13 |
Correct |
18 ms |
21776 KB |
Output is correct |
14 |
Correct |
24 ms |
21732 KB |
Output is correct |
15 |
Correct |
17 ms |
21856 KB |
Output is correct |
16 |
Correct |
26 ms |
21848 KB |
Output is correct |
17 |
Correct |
24 ms |
21856 KB |
Output is correct |
18 |
Correct |
25 ms |
21844 KB |
Output is correct |
19 |
Correct |
17 ms |
21964 KB |
Output is correct |
20 |
Correct |
16 ms |
21844 KB |
Output is correct |
21 |
Correct |
25 ms |
21844 KB |
Output is correct |
22 |
Correct |
17 ms |
21700 KB |
Output is correct |
23 |
Correct |
16 ms |
21776 KB |
Output is correct |
24 |
Correct |
26 ms |
21844 KB |
Output is correct |
25 |
Correct |
16 ms |
21844 KB |
Output is correct |
26 |
Correct |
24 ms |
21844 KB |
Output is correct |
27 |
Correct |
15 ms |
21840 KB |
Output is correct |
28 |
Correct |
20 ms |
21768 KB |
Output is correct |
29 |
Correct |
15 ms |
21864 KB |
Output is correct |
30 |
Correct |
24 ms |
21940 KB |
Output is correct |
31 |
Correct |
16 ms |
21844 KB |
Output is correct |
32 |
Correct |
15 ms |
21880 KB |
Output is correct |
33 |
Correct |
16 ms |
21588 KB |
Output is correct |
34 |
Correct |
15 ms |
21588 KB |
Output is correct |
35 |
Correct |
15 ms |
21676 KB |
Output is correct |
36 |
Correct |
23 ms |
21692 KB |
Output is correct |
37 |
Correct |
14 ms |
21724 KB |
Output is correct |
38 |
Correct |
16 ms |
21840 KB |
Output is correct |
39 |
Correct |
15 ms |
21840 KB |
Output is correct |
40 |
Correct |
15 ms |
21588 KB |
Output is correct |
41 |
Correct |
15 ms |
21644 KB |
Output is correct |
42 |
Correct |
20 ms |
21884 KB |
Output is correct |
43 |
Correct |
16 ms |
21852 KB |
Output is correct |
44 |
Correct |
15 ms |
21840 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
13 ms |
21588 KB |
Output is correct |
2 |
Correct |
13 ms |
19652 KB |
Output is correct |
3 |
Correct |
14 ms |
21588 KB |
Output is correct |
4 |
Correct |
13 ms |
21588 KB |
Output is correct |
5 |
Correct |
13 ms |
21076 KB |
Output is correct |
6 |
Correct |
18 ms |
21628 KB |
Output is correct |
7 |
Correct |
13 ms |
21000 KB |
Output is correct |
8 |
Correct |
53 ms |
25672 KB |
Output is correct |
9 |
Correct |
40 ms |
24624 KB |
Output is correct |
10 |
Correct |
35 ms |
24400 KB |
Output is correct |
11 |
Correct |
55 ms |
25060 KB |
Output is correct |
12 |
Correct |
53 ms |
24908 KB |
Output is correct |
13 |
Correct |
63 ms |
25052 KB |
Output is correct |
14 |
Correct |
59 ms |
24940 KB |
Output is correct |
15 |
Correct |
54 ms |
24904 KB |
Output is correct |
16 |
Correct |
67 ms |
24904 KB |
Output is correct |
17 |
Correct |
57 ms |
24920 KB |
Output is correct |
18 |
Correct |
51 ms |
24912 KB |
Output is correct |
19 |
Correct |
53 ms |
25112 KB |
Output is correct |
20 |
Correct |
50 ms |
24904 KB |
Output is correct |
21 |
Correct |
17 ms |
21588 KB |
Output is correct |
22 |
Correct |
15 ms |
21588 KB |
Output is correct |
23 |
Correct |
16 ms |
21588 KB |
Output is correct |
24 |
Correct |
16 ms |
21844 KB |
Output is correct |
25 |
Correct |
34 ms |
23880 KB |
Output is correct |
26 |
Correct |
53 ms |
25260 KB |
Output is correct |
27 |
Correct |
43 ms |
25260 KB |
Output is correct |
28 |
Correct |
41 ms |
25128 KB |
Output is correct |
29 |
Correct |
35 ms |
24392 KB |
Output is correct |
30 |
Correct |
48 ms |
25124 KB |
Output is correct |
31 |
Correct |
50 ms |
24904 KB |
Output is correct |
32 |
Correct |
47 ms |
24912 KB |
Output is correct |
33 |
Correct |
45 ms |
24904 KB |
Output is correct |
34 |
Correct |
52 ms |
24928 KB |
Output is correct |
35 |
Correct |
44 ms |
24904 KB |
Output is correct |
36 |
Correct |
44 ms |
24908 KB |
Output is correct |
37 |
Correct |
43 ms |
24624 KB |
Output is correct |
38 |
Correct |
50 ms |
24916 KB |
Output is correct |
39 |
Correct |
48 ms |
25016 KB |
Output is correct |
40 |
Correct |
43 ms |
24904 KB |
Output is correct |
41 |
Correct |
50 ms |
25076 KB |
Output is correct |
42 |
Correct |
58 ms |
24904 KB |
Output is correct |
43 |
Correct |
44 ms |
25060 KB |
Output is correct |
44 |
Correct |
61 ms |
25052 KB |
Output is correct |
45 |
Correct |
56 ms |
25064 KB |
Output is correct |
46 |
Correct |
63 ms |
25084 KB |
Output is correct |
47 |
Correct |
62 ms |
24912 KB |
Output is correct |
48 |
Correct |
39 ms |
24988 KB |
Output is correct |
49 |
Correct |
45 ms |
24904 KB |
Output is correct |
50 |
Correct |
43 ms |
25028 KB |
Output is correct |
51 |
Correct |
64 ms |
25048 KB |
Output is correct |
52 |
Correct |
42 ms |
24904 KB |
Output is correct |
53 |
Correct |
50 ms |
24928 KB |
Output is correct |
54 |
Correct |
49 ms |
25128 KB |
Output is correct |
55 |
Correct |
42 ms |
24980 KB |
Output is correct |
56 |
Correct |
41 ms |
24912 KB |
Output is correct |
57 |
Correct |
44 ms |
25128 KB |
Output is correct |
58 |
Correct |
40 ms |
24904 KB |
Output is correct |
59 |
Correct |
61 ms |
25160 KB |
Output is correct |
60 |
Correct |
49 ms |
24904 KB |
Output is correct |
61 |
Correct |
45 ms |
24912 KB |
Output is correct |
62 |
Correct |
67 ms |
24904 KB |
Output is correct |
63 |
Correct |
45 ms |
24912 KB |
Output is correct |
64 |
Correct |
42 ms |
25128 KB |
Output is correct |
65 |
Correct |
39 ms |
25056 KB |
Output is correct |
66 |
Correct |
38 ms |
24952 KB |
Output is correct |
67 |
Correct |
40 ms |
25168 KB |
Output is correct |
68 |
Correct |
40 ms |
25124 KB |
Output is correct |
69 |
Correct |
47 ms |
24932 KB |
Output is correct |
70 |
Correct |
48 ms |
24912 KB |
Output is correct |
71 |
Correct |
39 ms |
24908 KB |
Output is correct |
72 |
Correct |
14 ms |
21588 KB |
Output is correct |
73 |
Correct |
14 ms |
21588 KB |
Output is correct |
74 |
Correct |
65 ms |
25888 KB |
Output is correct |
75 |
Correct |
67 ms |
25656 KB |
Output is correct |
76 |
Correct |
45 ms |
25428 KB |
Output is correct |
77 |
Correct |
45 ms |
25048 KB |
Output is correct |
78 |
Correct |
61 ms |
25464 KB |
Output is correct |
79 |
Correct |
24 ms |
23472 KB |
Output is correct |
80 |
Correct |
15 ms |
21588 KB |
Output is correct |
81 |
Correct |
17 ms |
21588 KB |
Output is correct |
82 |
Correct |
14 ms |
21804 KB |
Output is correct |
83 |
Correct |
22 ms |
21588 KB |
Output is correct |
84 |
Correct |
14 ms |
21692 KB |
Output is correct |
85 |
Correct |
13 ms |
21588 KB |
Output is correct |
86 |
Correct |
13 ms |
21608 KB |
Output is correct |
87 |
Correct |
13 ms |
21076 KB |
Output is correct |
88 |
Correct |
15 ms |
21076 KB |
Output is correct |
89 |
Correct |
61 ms |
25684 KB |
Output is correct |
90 |
Correct |
31 ms |
24648 KB |
Output is correct |
91 |
Correct |
46 ms |
24544 KB |
Output is correct |
92 |
Correct |
41 ms |
24432 KB |
Output is correct |
93 |
Correct |
62 ms |
25052 KB |
Output is correct |
94 |
Correct |
43 ms |
24976 KB |
Output is correct |
95 |
Correct |
31 ms |
24904 KB |
Output is correct |
96 |
Correct |
34 ms |
24652 KB |
Output is correct |
97 |
Correct |
63 ms |
25712 KB |
Output is correct |
98 |
Correct |
31 ms |
24412 KB |
Output is correct |
99 |
Correct |
67 ms |
25628 KB |
Output is correct |
100 |
Correct |
16 ms |
21860 KB |
Output is correct |
101 |
Correct |
17 ms |
21848 KB |
Output is correct |
102 |
Correct |
17 ms |
21828 KB |
Output is correct |
103 |
Correct |
18 ms |
21776 KB |
Output is correct |
104 |
Correct |
24 ms |
21732 KB |
Output is correct |
105 |
Correct |
17 ms |
21856 KB |
Output is correct |
106 |
Correct |
26 ms |
21848 KB |
Output is correct |
107 |
Correct |
24 ms |
21856 KB |
Output is correct |
108 |
Correct |
25 ms |
23136 KB |
Output is correct |
109 |
Correct |
55 ms |
26480 KB |
Output is correct |
110 |
Correct |
76 ms |
26696 KB |
Output is correct |
111 |
Correct |
59 ms |
26952 KB |
Output is correct |
112 |
Correct |
80 ms |
26672 KB |
Output is correct |
113 |
Correct |
70 ms |
26736 KB |
Output is correct |
114 |
Correct |
66 ms |
25256 KB |
Output is correct |
115 |
Correct |
53 ms |
25160 KB |
Output is correct |
116 |
Correct |
33 ms |
25884 KB |
Output is correct |
117 |
Correct |
29 ms |
25968 KB |
Output is correct |
118 |
Correct |
32 ms |
25796 KB |
Output is correct |
119 |
Correct |
34 ms |
25760 KB |
Output is correct |
120 |
Correct |
56 ms |
24648 KB |
Output is correct |
121 |
Correct |
51 ms |
24464 KB |
Output is correct |
122 |
Correct |
56 ms |
24452 KB |
Output is correct |
123 |
Correct |
46 ms |
24764 KB |
Output is correct |
124 |
Correct |
48 ms |
24892 KB |
Output is correct |
125 |
Correct |
46 ms |
24784 KB |
Output is correct |
126 |
Correct |
52 ms |
26184 KB |
Output is correct |
127 |
Correct |
50 ms |
26136 KB |
Output is correct |
128 |
Correct |
53 ms |
26192 KB |
Output is correct |
129 |
Correct |
24 ms |
23980 KB |
Output is correct |
130 |
Correct |
77 ms |
26912 KB |
Output is correct |
131 |
Correct |
71 ms |
26348 KB |
Output is correct |
132 |
Correct |
69 ms |
26968 KB |
Output is correct |
133 |
Correct |
75 ms |
26704 KB |
Output is correct |
134 |
Correct |
65 ms |
26192 KB |
Output is correct |
135 |
Correct |
25 ms |
21844 KB |
Output is correct |
136 |
Correct |
17 ms |
21964 KB |
Output is correct |
137 |
Correct |
16 ms |
21844 KB |
Output is correct |
138 |
Correct |
25 ms |
21844 KB |
Output is correct |
139 |
Correct |
17 ms |
21700 KB |
Output is correct |
140 |
Correct |
16 ms |
21776 KB |
Output is correct |
141 |
Correct |
26 ms |
21844 KB |
Output is correct |
142 |
Correct |
16 ms |
21844 KB |
Output is correct |
143 |
Correct |
24 ms |
21844 KB |
Output is correct |
144 |
Correct |
15 ms |
21840 KB |
Output is correct |
145 |
Correct |
20 ms |
21768 KB |
Output is correct |
146 |
Correct |
15 ms |
21864 KB |
Output is correct |
147 |
Correct |
24 ms |
21940 KB |
Output is correct |
148 |
Correct |
16 ms |
21844 KB |
Output is correct |
149 |
Correct |
15 ms |
21880 KB |
Output is correct |
150 |
Correct |
16 ms |
21588 KB |
Output is correct |
151 |
Correct |
15 ms |
21588 KB |
Output is correct |
152 |
Correct |
15 ms |
21676 KB |
Output is correct |
153 |
Correct |
23 ms |
21692 KB |
Output is correct |
154 |
Correct |
14 ms |
21724 KB |
Output is correct |
155 |
Correct |
16 ms |
21840 KB |
Output is correct |
156 |
Correct |
15 ms |
21840 KB |
Output is correct |
157 |
Correct |
15 ms |
21588 KB |
Output is correct |
158 |
Correct |
15 ms |
21644 KB |
Output is correct |
159 |
Correct |
20 ms |
21884 KB |
Output is correct |
160 |
Correct |
16 ms |
21852 KB |
Output is correct |
161 |
Correct |
15 ms |
21840 KB |
Output is correct |
162 |
Correct |
47 ms |
25416 KB |
Output is correct |
163 |
Correct |
16 ms |
21844 KB |
Output is correct |
164 |
Correct |
21 ms |
22100 KB |
Output is correct |
165 |
Correct |
20 ms |
22356 KB |
Output is correct |
166 |
Correct |
26 ms |
22888 KB |
Output is correct |
167 |
Correct |
32 ms |
23624 KB |
Output is correct |
168 |
Correct |
30 ms |
25772 KB |
Output is correct |
169 |
Correct |
48 ms |
25636 KB |
Output is correct |
170 |
Correct |
31 ms |
25664 KB |
Output is correct |
171 |
Correct |
32 ms |
26112 KB |
Output is correct |
172 |
Correct |
19 ms |
22100 KB |
Output is correct |
173 |
Correct |
20 ms |
22088 KB |
Output is correct |
174 |
Correct |
21 ms |
22224 KB |
Output is correct |
175 |
Correct |
17 ms |
21996 KB |
Output is correct |
176 |
Correct |
18 ms |
22008 KB |
Output is correct |
177 |
Correct |
19 ms |
22176 KB |
Output is correct |
178 |
Correct |
44 ms |
25672 KB |
Output is correct |
179 |
Correct |
52 ms |
25620 KB |
Output is correct |
180 |
Correct |
46 ms |
24596 KB |
Output is correct |
181 |
Correct |
44 ms |
24548 KB |
Output is correct |
182 |
Correct |
40 ms |
24628 KB |
Output is correct |
183 |
Correct |
43 ms |
24596 KB |
Output is correct |
184 |
Correct |
42 ms |
24680 KB |
Output is correct |
185 |
Correct |
45 ms |
24676 KB |
Output is correct |
186 |
Correct |
45 ms |
24648 KB |
Output is correct |
187 |
Correct |
68 ms |
24768 KB |
Output is correct |
188 |
Correct |
60 ms |
26164 KB |
Output is correct |
189 |
Correct |
55 ms |
26088 KB |
Output is correct |
190 |
Correct |
46 ms |
26024 KB |
Output is correct |
191 |
Correct |
57 ms |
26184 KB |
Output is correct |
192 |
Correct |
51 ms |
24508 KB |
Output is correct |
193 |
Correct |
68 ms |
24648 KB |
Output is correct |
194 |
Correct |
42 ms |
24460 KB |
Output is correct |
195 |
Correct |
55 ms |
24468 KB |
Output is correct |
196 |
Correct |
51 ms |
24748 KB |
Output is correct |
197 |
Correct |
57 ms |
24648 KB |
Output is correct |
198 |
Correct |
49 ms |
24652 KB |
Output is correct |
199 |
Correct |
55 ms |
24648 KB |
Output is correct |
200 |
Correct |
62 ms |
26024 KB |
Output is correct |
201 |
Correct |
46 ms |
26084 KB |
Output is correct |
202 |
Correct |
42 ms |
26228 KB |
Output is correct |
203 |
Correct |
53 ms |
26120 KB |
Output is correct |
204 |
Correct |
48 ms |
24648 KB |
Output is correct |
205 |
Correct |
45 ms |
24440 KB |
Output is correct |
206 |
Correct |
43 ms |
24684 KB |
Output is correct |
207 |
Correct |
56 ms |
24528 KB |
Output is correct |
208 |
Correct |
53 ms |
24680 KB |
Output is correct |
209 |
Correct |
67 ms |
24780 KB |
Output is correct |
210 |
Correct |
52 ms |
24648 KB |
Output is correct |
211 |
Correct |
51 ms |
24648 KB |
Output is correct |
212 |
Correct |
45 ms |
26184 KB |
Output is correct |
213 |
Correct |
50 ms |
26028 KB |
Output is correct |
214 |
Correct |
45 ms |
26196 KB |
Output is correct |
215 |
Correct |
46 ms |
26184 KB |
Output is correct |
216 |
Correct |
28 ms |
23888 KB |
Output is correct |
217 |
Correct |
62 ms |
26792 KB |
Output is correct |
218 |
Correct |
56 ms |
26448 KB |
Output is correct |
219 |
Correct |
60 ms |
26952 KB |
Output is correct |
220 |
Correct |
64 ms |
26696 KB |
Output is correct |
221 |
Correct |
60 ms |
26188 KB |
Output is correct |