#include "closing.h"
#include <cstdlib>
#include <cstring>
#include <vector>
using namespace std;
typedef vector<int> vi;
const int N = 200000;
const long long INF = 0x3f3f3f3f3f3f3f3fLL;
long long min(long long a, long long b) { return a < b ? a : b; }
long long max(long long a, long long b) { return a > b ? a : b; }
unsigned int X = 12345;
int rand_() {
return (X *= 3) >> 1;
}
int *ej[N], *ew[N], eo[N];
void append(int i, int j, int w) {
int o = eo[i]++;
if (o >= 2 && (o & o - 1) == 0) {
ej[i] = (int *) realloc(ej[i], o * 2 * sizeof *ej[i]);
ew[i] = (int *) realloc(ew[i], o * 2 * sizeof *ew[i]);
}
ej[i][o] = j, ew[i][o] = w;
}
int pp[N]; long long *dd; char path[N];
long long dds[N], ddt[N]; int ii[N];
long long dd1[N * 2]; int ii1[N * 2], n1;
long long dda2[N], ddb2[N]; int ii2[N], n2;
long long dp1[N * 2 + 1], dp2[N * 2 + 1];
void dfs(int p, int i, long long d) {
pp[i] = p, dd[i] = d;
for (int o = eo[i]; o--; ) {
int j = ej[i][o], w = ew[i][o];
if (j != p)
dfs(i, j, d + w);
}
}
int compare_ds(int i, int j) {
return dds[i] == dds[j] ? 0 : (dds[i] < dds[j] ? -1 : 1);
}
int compare_d1(int i, int j) {
return dd1[i] == dd1[j] ? 0 : (dd1[i] < dd1[j] ? -1 : 1);
}
int compare_db2(int i, int j) {
return ddb2[i] == ddb2[j] ? 0 : (ddb2[i] < ddb2[j] ? -1 : 1);
}
int (*compare)(int, int);
void sort(int *ii, int l, int r) {
while (l < r) {
int i = l, j = l, k = r, i_ = ii[l + rand_() % (r - l)], tmp;
while (j < k) {
int c = compare(ii[j], i_);
if (c == 0)
j++;
else if (c < 0) {
tmp = ii[i], ii[i] = ii[j], ii[j] = tmp;
i++, j++;
} else {
k--;
tmp = ii[j], ii[j] = ii[k], ii[k] = tmp;
}
}
sort(ii, l, i);
l = k;
}
}
int max_score(int n, int s, int t, long long c_, vi uu, vi vv, vi ww) {
for (int i = 0; i < n; i++) {
ej[i] = (int *) malloc(2 * sizeof *ej[i]);
ew[i] = (int *) malloc(2 * sizeof *ew[i]);
eo[i] = 0;
}
for (int h = 0; h < n - 1; h++)
append(uu[h], vv[h], ww[h]), append(vv[h], uu[h], ww[h]);
dd = dds, dfs(-1, s, 0);
dd = ddt, dfs(-1, t, 0);
for (int i = 0; i < n; i++)
if (dds[i] > ddt[i]) {
long long tmp;
tmp = dds[i], dds[i] = ddt[i], ddt[i] = tmp;
}
for (int i = 0; i < n; i++)
ii[i] = i;
compare = compare_ds, sort(ii, 0, n);
int k = 0; long long c = 0;
while (k < n && c + dds[ii[k]] <= c_)
c += dds[ii[k++]];
memset(path, 0, n * sizeof *path);
for (int i = s; i != -1; i = pp[i])
path[i] = 1;
int k0 = 0; n1 = 0, n2 = 0;
for (int i = 0; i < n; i++)
if (path[i]) {
c_ -= dds[i], k0++;
dd1[n1++] = ddt[i] - dds[i];
} else if (dds[i] <= ddt[i] - dds[i])
dd1[n1++] = dds[i], dd1[n1++] = ddt[i] - dds[i];
else
dda2[n2] = dds[i], ddb2[n2] = ddt[i], n2++;
if (c_ >= 0) {
for (int i = 0; i < n1; i++)
ii1[i] = i;
compare = compare_d1, sort(ii1, 0, n1);
memset(dp1, 0x3f, (n1 + 1) * sizeof *dp1), dp1[0] = 0;
for (int i = 0; i < n1; i++)
dp1[i + 1] = dp1[i] + dd1[ii1[i]];
for (int i = 0; i < n2; i++)
ii2[i] = i;
compare = compare_db2, sort(ii2, 0, n2);
memset(dp2, 0x3f, (n2 * 2 + 1) * sizeof *dp2), dp2[0] = 0;
long long b = 0, d = 0;
for (int i = 0; i < n2; i++) {
d = max(d, ddb2[ii2[i]] - dda2[ii2[i]]), b += ddb2[ii2[i]];
dp2[(i + 1) * 2] = b;
dp2[(i + 1) * 2 - 1] = b - d;
}
long long a = INF;
for (int i = n2 - 1; i >= 0; i--) {
a = min(a, dda2[ii2[i]]), b -= ddb2[ii2[i]];
dp2[i * 2 + 1] = min(dp2[i * 2 + 1], b + a);
}
for (int k1 = 0, k2 = n2 * 2; k1 <= n1; k1++) {
while (k2 >= 0 && dp1[k1] + dp2[k2] > c_)
k2--;
if (k2 >= 0)
k = max(k, k0 + k1 + k2);
}
}
for (int i = 0; i < n; i++)
free(ej[i]), free(ew[i]);
return k;
}
Compilation message
closing.cpp: In function 'void append(int, int, int)':
closing.cpp:26:23: warning: suggest parentheses around '-' in operand of '&' [-Wparentheses]
26 | if (o >= 2 && (o & o - 1) == 0) {
| ~~^~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
20824 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
153 ms |
41784 KB |
Output is correct |
2 |
Correct |
168 ms |
47472 KB |
Output is correct |
3 |
Correct |
78 ms |
21328 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
18776 KB |
Output is correct |
2 |
Correct |
2 ms |
20828 KB |
Output is correct |
3 |
Correct |
2 ms |
20824 KB |
Output is correct |
4 |
Correct |
2 ms |
18780 KB |
Output is correct |
5 |
Correct |
2 ms |
18776 KB |
Output is correct |
6 |
Correct |
2 ms |
20828 KB |
Output is correct |
7 |
Correct |
3 ms |
20824 KB |
Output is correct |
8 |
Correct |
2 ms |
18780 KB |
Output is correct |
9 |
Correct |
2 ms |
19032 KB |
Output is correct |
10 |
Correct |
2 ms |
16728 KB |
Output is correct |
11 |
Correct |
2 ms |
16728 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
18776 KB |
Output is correct |
2 |
Correct |
2 ms |
20828 KB |
Output is correct |
3 |
Correct |
2 ms |
20824 KB |
Output is correct |
4 |
Correct |
2 ms |
18780 KB |
Output is correct |
5 |
Correct |
2 ms |
18776 KB |
Output is correct |
6 |
Correct |
2 ms |
20828 KB |
Output is correct |
7 |
Correct |
3 ms |
20824 KB |
Output is correct |
8 |
Correct |
2 ms |
18780 KB |
Output is correct |
9 |
Correct |
2 ms |
19032 KB |
Output is correct |
10 |
Correct |
2 ms |
16728 KB |
Output is correct |
11 |
Correct |
2 ms |
16728 KB |
Output is correct |
12 |
Correct |
3 ms |
20824 KB |
Output is correct |
13 |
Correct |
3 ms |
20824 KB |
Output is correct |
14 |
Correct |
2 ms |
18776 KB |
Output is correct |
15 |
Correct |
2 ms |
18780 KB |
Output is correct |
16 |
Correct |
3 ms |
16728 KB |
Output is correct |
17 |
Correct |
2 ms |
16728 KB |
Output is correct |
18 |
Correct |
4 ms |
20828 KB |
Output is correct |
19 |
Correct |
3 ms |
20824 KB |
Output is correct |
20 |
Correct |
3 ms |
20824 KB |
Output is correct |
21 |
Correct |
3 ms |
18780 KB |
Output is correct |
22 |
Correct |
2 ms |
18780 KB |
Output is correct |
23 |
Correct |
2 ms |
16728 KB |
Output is correct |
24 |
Correct |
2 ms |
16728 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
18776 KB |
Output is correct |
2 |
Correct |
2 ms |
20828 KB |
Output is correct |
3 |
Correct |
2 ms |
20824 KB |
Output is correct |
4 |
Correct |
2 ms |
18780 KB |
Output is correct |
5 |
Correct |
2 ms |
18776 KB |
Output is correct |
6 |
Correct |
2 ms |
20828 KB |
Output is correct |
7 |
Correct |
3 ms |
20824 KB |
Output is correct |
8 |
Correct |
2 ms |
18780 KB |
Output is correct |
9 |
Correct |
2 ms |
19032 KB |
Output is correct |
10 |
Correct |
2 ms |
16728 KB |
Output is correct |
11 |
Correct |
2 ms |
16728 KB |
Output is correct |
12 |
Correct |
3 ms |
20824 KB |
Output is correct |
13 |
Correct |
3 ms |
20824 KB |
Output is correct |
14 |
Correct |
2 ms |
18776 KB |
Output is correct |
15 |
Correct |
2 ms |
18780 KB |
Output is correct |
16 |
Correct |
3 ms |
16728 KB |
Output is correct |
17 |
Correct |
2 ms |
16728 KB |
Output is correct |
18 |
Correct |
4 ms |
20828 KB |
Output is correct |
19 |
Correct |
3 ms |
20824 KB |
Output is correct |
20 |
Correct |
3 ms |
20824 KB |
Output is correct |
21 |
Correct |
3 ms |
18780 KB |
Output is correct |
22 |
Correct |
2 ms |
18780 KB |
Output is correct |
23 |
Correct |
2 ms |
16728 KB |
Output is correct |
24 |
Correct |
2 ms |
16728 KB |
Output is correct |
25 |
Correct |
3 ms |
20824 KB |
Output is correct |
26 |
Correct |
4 ms |
21336 KB |
Output is correct |
27 |
Correct |
4 ms |
21336 KB |
Output is correct |
28 |
Correct |
4 ms |
19288 KB |
Output is correct |
29 |
Correct |
4 ms |
19288 KB |
Output is correct |
30 |
Correct |
3 ms |
19288 KB |
Output is correct |
31 |
Correct |
3 ms |
17240 KB |
Output is correct |
32 |
Correct |
3 ms |
17240 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
20824 KB |
Output is correct |
2 |
Correct |
2 ms |
18776 KB |
Output is correct |
3 |
Correct |
2 ms |
20828 KB |
Output is correct |
4 |
Correct |
2 ms |
20824 KB |
Output is correct |
5 |
Correct |
2 ms |
18780 KB |
Output is correct |
6 |
Correct |
2 ms |
18776 KB |
Output is correct |
7 |
Correct |
2 ms |
20824 KB |
Output is correct |
8 |
Correct |
2 ms |
20824 KB |
Output is correct |
9 |
Correct |
2 ms |
20824 KB |
Output is correct |
10 |
Correct |
3 ms |
20824 KB |
Output is correct |
11 |
Correct |
3 ms |
20824 KB |
Output is correct |
12 |
Correct |
2 ms |
18776 KB |
Output is correct |
13 |
Correct |
2 ms |
20828 KB |
Output is correct |
14 |
Correct |
2 ms |
20824 KB |
Output is correct |
15 |
Correct |
3 ms |
20824 KB |
Output is correct |
16 |
Correct |
2 ms |
20824 KB |
Output is correct |
17 |
Correct |
2 ms |
18780 KB |
Output is correct |
18 |
Correct |
2 ms |
20828 KB |
Output is correct |
19 |
Correct |
3 ms |
20824 KB |
Output is correct |
20 |
Correct |
2 ms |
20824 KB |
Output is correct |
21 |
Correct |
2 ms |
20824 KB |
Output is correct |
22 |
Correct |
2 ms |
20824 KB |
Output is correct |
23 |
Correct |
3 ms |
20824 KB |
Output is correct |
24 |
Correct |
2 ms |
20824 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
20824 KB |
Output is correct |
2 |
Correct |
2 ms |
18776 KB |
Output is correct |
3 |
Correct |
2 ms |
20828 KB |
Output is correct |
4 |
Correct |
2 ms |
20824 KB |
Output is correct |
5 |
Correct |
2 ms |
18780 KB |
Output is correct |
6 |
Correct |
2 ms |
18776 KB |
Output is correct |
7 |
Correct |
2 ms |
20828 KB |
Output is correct |
8 |
Correct |
3 ms |
20824 KB |
Output is correct |
9 |
Correct |
2 ms |
18780 KB |
Output is correct |
10 |
Correct |
2 ms |
19032 KB |
Output is correct |
11 |
Correct |
2 ms |
16728 KB |
Output is correct |
12 |
Correct |
2 ms |
16728 KB |
Output is correct |
13 |
Correct |
3 ms |
20824 KB |
Output is correct |
14 |
Correct |
3 ms |
20824 KB |
Output is correct |
15 |
Correct |
2 ms |
18776 KB |
Output is correct |
16 |
Correct |
2 ms |
18780 KB |
Output is correct |
17 |
Correct |
3 ms |
16728 KB |
Output is correct |
18 |
Correct |
2 ms |
16728 KB |
Output is correct |
19 |
Correct |
2 ms |
20824 KB |
Output is correct |
20 |
Correct |
2 ms |
20824 KB |
Output is correct |
21 |
Correct |
2 ms |
20824 KB |
Output is correct |
22 |
Correct |
3 ms |
20824 KB |
Output is correct |
23 |
Correct |
3 ms |
20824 KB |
Output is correct |
24 |
Correct |
2 ms |
18776 KB |
Output is correct |
25 |
Correct |
2 ms |
20828 KB |
Output is correct |
26 |
Correct |
2 ms |
20824 KB |
Output is correct |
27 |
Correct |
3 ms |
20824 KB |
Output is correct |
28 |
Correct |
2 ms |
20824 KB |
Output is correct |
29 |
Correct |
2 ms |
18780 KB |
Output is correct |
30 |
Correct |
2 ms |
20828 KB |
Output is correct |
31 |
Correct |
3 ms |
20824 KB |
Output is correct |
32 |
Correct |
2 ms |
20824 KB |
Output is correct |
33 |
Correct |
2 ms |
20824 KB |
Output is correct |
34 |
Correct |
2 ms |
20824 KB |
Output is correct |
35 |
Correct |
3 ms |
20824 KB |
Output is correct |
36 |
Correct |
2 ms |
20824 KB |
Output is correct |
37 |
Correct |
3 ms |
20824 KB |
Output is correct |
38 |
Correct |
2 ms |
20836 KB |
Output is correct |
39 |
Correct |
2 ms |
20828 KB |
Output is correct |
40 |
Correct |
3 ms |
20824 KB |
Output is correct |
41 |
Correct |
2 ms |
20824 KB |
Output is correct |
42 |
Correct |
2 ms |
18776 KB |
Output is correct |
43 |
Correct |
2 ms |
20828 KB |
Output is correct |
44 |
Correct |
2 ms |
20824 KB |
Output is correct |
45 |
Correct |
2 ms |
18776 KB |
Output is correct |
46 |
Correct |
2 ms |
20828 KB |
Output is correct |
47 |
Correct |
2 ms |
20828 KB |
Output is correct |
48 |
Correct |
2 ms |
20828 KB |
Output is correct |
49 |
Correct |
3 ms |
20824 KB |
Output is correct |
50 |
Correct |
3 ms |
20824 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
20824 KB |
Output is correct |
2 |
Correct |
2 ms |
18776 KB |
Output is correct |
3 |
Correct |
2 ms |
20828 KB |
Output is correct |
4 |
Correct |
2 ms |
20824 KB |
Output is correct |
5 |
Correct |
2 ms |
18780 KB |
Output is correct |
6 |
Correct |
2 ms |
18776 KB |
Output is correct |
7 |
Correct |
2 ms |
20828 KB |
Output is correct |
8 |
Correct |
3 ms |
20824 KB |
Output is correct |
9 |
Correct |
2 ms |
18780 KB |
Output is correct |
10 |
Correct |
2 ms |
19032 KB |
Output is correct |
11 |
Correct |
2 ms |
16728 KB |
Output is correct |
12 |
Correct |
2 ms |
16728 KB |
Output is correct |
13 |
Correct |
3 ms |
20824 KB |
Output is correct |
14 |
Correct |
3 ms |
20824 KB |
Output is correct |
15 |
Correct |
2 ms |
18776 KB |
Output is correct |
16 |
Correct |
2 ms |
18780 KB |
Output is correct |
17 |
Correct |
3 ms |
16728 KB |
Output is correct |
18 |
Correct |
2 ms |
16728 KB |
Output is correct |
19 |
Correct |
4 ms |
20828 KB |
Output is correct |
20 |
Correct |
3 ms |
20824 KB |
Output is correct |
21 |
Correct |
3 ms |
20824 KB |
Output is correct |
22 |
Correct |
3 ms |
18780 KB |
Output is correct |
23 |
Correct |
2 ms |
18780 KB |
Output is correct |
24 |
Correct |
2 ms |
16728 KB |
Output is correct |
25 |
Correct |
2 ms |
16728 KB |
Output is correct |
26 |
Correct |
2 ms |
20824 KB |
Output is correct |
27 |
Correct |
2 ms |
20824 KB |
Output is correct |
28 |
Correct |
2 ms |
20824 KB |
Output is correct |
29 |
Correct |
3 ms |
20824 KB |
Output is correct |
30 |
Correct |
3 ms |
20824 KB |
Output is correct |
31 |
Correct |
2 ms |
18776 KB |
Output is correct |
32 |
Correct |
2 ms |
20828 KB |
Output is correct |
33 |
Correct |
2 ms |
20824 KB |
Output is correct |
34 |
Correct |
3 ms |
20824 KB |
Output is correct |
35 |
Correct |
2 ms |
20824 KB |
Output is correct |
36 |
Correct |
2 ms |
18780 KB |
Output is correct |
37 |
Correct |
2 ms |
20828 KB |
Output is correct |
38 |
Correct |
3 ms |
20824 KB |
Output is correct |
39 |
Correct |
2 ms |
20824 KB |
Output is correct |
40 |
Correct |
2 ms |
20824 KB |
Output is correct |
41 |
Correct |
2 ms |
20824 KB |
Output is correct |
42 |
Correct |
3 ms |
20824 KB |
Output is correct |
43 |
Correct |
2 ms |
20824 KB |
Output is correct |
44 |
Correct |
3 ms |
20824 KB |
Output is correct |
45 |
Correct |
2 ms |
20836 KB |
Output is correct |
46 |
Correct |
2 ms |
20828 KB |
Output is correct |
47 |
Correct |
3 ms |
20824 KB |
Output is correct |
48 |
Correct |
2 ms |
20824 KB |
Output is correct |
49 |
Correct |
2 ms |
18776 KB |
Output is correct |
50 |
Correct |
2 ms |
20828 KB |
Output is correct |
51 |
Correct |
2 ms |
20824 KB |
Output is correct |
52 |
Correct |
2 ms |
18776 KB |
Output is correct |
53 |
Correct |
2 ms |
20828 KB |
Output is correct |
54 |
Correct |
2 ms |
20828 KB |
Output is correct |
55 |
Correct |
2 ms |
20828 KB |
Output is correct |
56 |
Correct |
3 ms |
20824 KB |
Output is correct |
57 |
Correct |
3 ms |
20824 KB |
Output is correct |
58 |
Correct |
2 ms |
20824 KB |
Output is correct |
59 |
Correct |
3 ms |
20824 KB |
Output is correct |
60 |
Correct |
2 ms |
20824 KB |
Output is correct |
61 |
Correct |
3 ms |
20824 KB |
Output is correct |
62 |
Correct |
3 ms |
20828 KB |
Output is correct |
63 |
Correct |
2 ms |
20824 KB |
Output is correct |
64 |
Correct |
3 ms |
20824 KB |
Output is correct |
65 |
Correct |
3 ms |
20828 KB |
Output is correct |
66 |
Correct |
2 ms |
20824 KB |
Output is correct |
67 |
Correct |
2 ms |
18776 KB |
Output is correct |
68 |
Correct |
2 ms |
20824 KB |
Output is correct |
69 |
Correct |
3 ms |
20824 KB |
Output is correct |
70 |
Correct |
3 ms |
18780 KB |
Output is correct |
71 |
Correct |
2 ms |
18776 KB |
Output is correct |
72 |
Correct |
3 ms |
20828 KB |
Output is correct |
73 |
Correct |
3 ms |
20824 KB |
Output is correct |
74 |
Correct |
3 ms |
20828 KB |
Output is correct |
75 |
Correct |
2 ms |
20824 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
20824 KB |
Output is correct |
2 |
Correct |
2 ms |
18776 KB |
Output is correct |
3 |
Correct |
2 ms |
20828 KB |
Output is correct |
4 |
Correct |
2 ms |
20824 KB |
Output is correct |
5 |
Correct |
2 ms |
18780 KB |
Output is correct |
6 |
Correct |
2 ms |
18776 KB |
Output is correct |
7 |
Correct |
2 ms |
20828 KB |
Output is correct |
8 |
Correct |
3 ms |
20824 KB |
Output is correct |
9 |
Correct |
2 ms |
18780 KB |
Output is correct |
10 |
Correct |
2 ms |
19032 KB |
Output is correct |
11 |
Correct |
2 ms |
16728 KB |
Output is correct |
12 |
Correct |
2 ms |
16728 KB |
Output is correct |
13 |
Correct |
3 ms |
20824 KB |
Output is correct |
14 |
Correct |
3 ms |
20824 KB |
Output is correct |
15 |
Correct |
2 ms |
18776 KB |
Output is correct |
16 |
Correct |
2 ms |
18780 KB |
Output is correct |
17 |
Correct |
3 ms |
16728 KB |
Output is correct |
18 |
Correct |
2 ms |
16728 KB |
Output is correct |
19 |
Correct |
4 ms |
20828 KB |
Output is correct |
20 |
Correct |
3 ms |
20824 KB |
Output is correct |
21 |
Correct |
3 ms |
20824 KB |
Output is correct |
22 |
Correct |
3 ms |
18780 KB |
Output is correct |
23 |
Correct |
2 ms |
18780 KB |
Output is correct |
24 |
Correct |
2 ms |
16728 KB |
Output is correct |
25 |
Correct |
2 ms |
16728 KB |
Output is correct |
26 |
Correct |
3 ms |
20824 KB |
Output is correct |
27 |
Correct |
4 ms |
21336 KB |
Output is correct |
28 |
Correct |
4 ms |
21336 KB |
Output is correct |
29 |
Correct |
4 ms |
19288 KB |
Output is correct |
30 |
Correct |
4 ms |
19288 KB |
Output is correct |
31 |
Correct |
3 ms |
19288 KB |
Output is correct |
32 |
Correct |
3 ms |
17240 KB |
Output is correct |
33 |
Correct |
3 ms |
17240 KB |
Output is correct |
34 |
Correct |
2 ms |
20824 KB |
Output is correct |
35 |
Correct |
2 ms |
20824 KB |
Output is correct |
36 |
Correct |
2 ms |
20824 KB |
Output is correct |
37 |
Correct |
3 ms |
20824 KB |
Output is correct |
38 |
Correct |
3 ms |
20824 KB |
Output is correct |
39 |
Correct |
2 ms |
18776 KB |
Output is correct |
40 |
Correct |
2 ms |
20828 KB |
Output is correct |
41 |
Correct |
2 ms |
20824 KB |
Output is correct |
42 |
Correct |
3 ms |
20824 KB |
Output is correct |
43 |
Correct |
2 ms |
20824 KB |
Output is correct |
44 |
Correct |
2 ms |
18780 KB |
Output is correct |
45 |
Correct |
2 ms |
20828 KB |
Output is correct |
46 |
Correct |
3 ms |
20824 KB |
Output is correct |
47 |
Correct |
2 ms |
20824 KB |
Output is correct |
48 |
Correct |
2 ms |
20824 KB |
Output is correct |
49 |
Correct |
2 ms |
20824 KB |
Output is correct |
50 |
Correct |
3 ms |
20824 KB |
Output is correct |
51 |
Correct |
2 ms |
20824 KB |
Output is correct |
52 |
Correct |
3 ms |
20824 KB |
Output is correct |
53 |
Correct |
2 ms |
20836 KB |
Output is correct |
54 |
Correct |
2 ms |
20828 KB |
Output is correct |
55 |
Correct |
3 ms |
20824 KB |
Output is correct |
56 |
Correct |
2 ms |
20824 KB |
Output is correct |
57 |
Correct |
2 ms |
18776 KB |
Output is correct |
58 |
Correct |
2 ms |
20828 KB |
Output is correct |
59 |
Correct |
2 ms |
20824 KB |
Output is correct |
60 |
Correct |
2 ms |
18776 KB |
Output is correct |
61 |
Correct |
2 ms |
20828 KB |
Output is correct |
62 |
Correct |
2 ms |
20828 KB |
Output is correct |
63 |
Correct |
2 ms |
20828 KB |
Output is correct |
64 |
Correct |
3 ms |
20824 KB |
Output is correct |
65 |
Correct |
3 ms |
20824 KB |
Output is correct |
66 |
Correct |
2 ms |
20824 KB |
Output is correct |
67 |
Correct |
3 ms |
20824 KB |
Output is correct |
68 |
Correct |
2 ms |
20824 KB |
Output is correct |
69 |
Correct |
3 ms |
20824 KB |
Output is correct |
70 |
Correct |
3 ms |
20828 KB |
Output is correct |
71 |
Correct |
2 ms |
20824 KB |
Output is correct |
72 |
Correct |
3 ms |
20824 KB |
Output is correct |
73 |
Correct |
3 ms |
20828 KB |
Output is correct |
74 |
Correct |
2 ms |
20824 KB |
Output is correct |
75 |
Correct |
2 ms |
18776 KB |
Output is correct |
76 |
Correct |
2 ms |
20824 KB |
Output is correct |
77 |
Correct |
3 ms |
20824 KB |
Output is correct |
78 |
Correct |
3 ms |
18780 KB |
Output is correct |
79 |
Correct |
2 ms |
18776 KB |
Output is correct |
80 |
Correct |
3 ms |
20828 KB |
Output is correct |
81 |
Correct |
3 ms |
20824 KB |
Output is correct |
82 |
Correct |
3 ms |
20828 KB |
Output is correct |
83 |
Correct |
2 ms |
20824 KB |
Output is correct |
84 |
Correct |
3 ms |
20824 KB |
Output is correct |
85 |
Correct |
3 ms |
20824 KB |
Output is correct |
86 |
Correct |
4 ms |
20824 KB |
Output is correct |
87 |
Correct |
3 ms |
20824 KB |
Output is correct |
88 |
Correct |
4 ms |
20828 KB |
Output is correct |
89 |
Correct |
4 ms |
21080 KB |
Output is correct |
90 |
Correct |
4 ms |
21084 KB |
Output is correct |
91 |
Correct |
4 ms |
21080 KB |
Output is correct |
92 |
Correct |
4 ms |
21084 KB |
Output is correct |
93 |
Correct |
3 ms |
19032 KB |
Output is correct |
94 |
Correct |
4 ms |
21336 KB |
Output is correct |
95 |
Correct |
4 ms |
21336 KB |
Output is correct |
96 |
Correct |
3 ms |
19032 KB |
Output is correct |
97 |
Correct |
4 ms |
21080 KB |
Output is correct |
98 |
Correct |
4 ms |
21084 KB |
Output is correct |
99 |
Correct |
4 ms |
21084 KB |
Output is correct |
100 |
Correct |
4 ms |
21080 KB |
Output is correct |
101 |
Correct |
4 ms |
20824 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
20824 KB |
Output is correct |
2 |
Correct |
2 ms |
18776 KB |
Output is correct |
3 |
Correct |
2 ms |
20828 KB |
Output is correct |
4 |
Correct |
2 ms |
20824 KB |
Output is correct |
5 |
Correct |
2 ms |
18780 KB |
Output is correct |
6 |
Correct |
2 ms |
18776 KB |
Output is correct |
7 |
Correct |
2 ms |
20828 KB |
Output is correct |
8 |
Correct |
3 ms |
20824 KB |
Output is correct |
9 |
Correct |
2 ms |
18780 KB |
Output is correct |
10 |
Correct |
2 ms |
19032 KB |
Output is correct |
11 |
Correct |
2 ms |
16728 KB |
Output is correct |
12 |
Correct |
2 ms |
16728 KB |
Output is correct |
13 |
Correct |
3 ms |
20824 KB |
Output is correct |
14 |
Correct |
3 ms |
20824 KB |
Output is correct |
15 |
Correct |
2 ms |
18776 KB |
Output is correct |
16 |
Correct |
2 ms |
18780 KB |
Output is correct |
17 |
Correct |
3 ms |
16728 KB |
Output is correct |
18 |
Correct |
2 ms |
16728 KB |
Output is correct |
19 |
Correct |
4 ms |
20828 KB |
Output is correct |
20 |
Correct |
3 ms |
20824 KB |
Output is correct |
21 |
Correct |
3 ms |
20824 KB |
Output is correct |
22 |
Correct |
3 ms |
18780 KB |
Output is correct |
23 |
Correct |
2 ms |
18780 KB |
Output is correct |
24 |
Correct |
2 ms |
16728 KB |
Output is correct |
25 |
Correct |
2 ms |
16728 KB |
Output is correct |
26 |
Correct |
3 ms |
20824 KB |
Output is correct |
27 |
Correct |
4 ms |
21336 KB |
Output is correct |
28 |
Correct |
4 ms |
21336 KB |
Output is correct |
29 |
Correct |
4 ms |
19288 KB |
Output is correct |
30 |
Correct |
4 ms |
19288 KB |
Output is correct |
31 |
Correct |
3 ms |
19288 KB |
Output is correct |
32 |
Correct |
3 ms |
17240 KB |
Output is correct |
33 |
Correct |
3 ms |
17240 KB |
Output is correct |
34 |
Correct |
2 ms |
20824 KB |
Output is correct |
35 |
Correct |
2 ms |
20824 KB |
Output is correct |
36 |
Correct |
2 ms |
20824 KB |
Output is correct |
37 |
Correct |
3 ms |
20824 KB |
Output is correct |
38 |
Correct |
3 ms |
20824 KB |
Output is correct |
39 |
Correct |
2 ms |
18776 KB |
Output is correct |
40 |
Correct |
2 ms |
20828 KB |
Output is correct |
41 |
Correct |
2 ms |
20824 KB |
Output is correct |
42 |
Correct |
3 ms |
20824 KB |
Output is correct |
43 |
Correct |
2 ms |
20824 KB |
Output is correct |
44 |
Correct |
2 ms |
18780 KB |
Output is correct |
45 |
Correct |
2 ms |
20828 KB |
Output is correct |
46 |
Correct |
3 ms |
20824 KB |
Output is correct |
47 |
Correct |
2 ms |
20824 KB |
Output is correct |
48 |
Correct |
2 ms |
20824 KB |
Output is correct |
49 |
Correct |
2 ms |
20824 KB |
Output is correct |
50 |
Correct |
3 ms |
20824 KB |
Output is correct |
51 |
Correct |
2 ms |
20824 KB |
Output is correct |
52 |
Correct |
3 ms |
20824 KB |
Output is correct |
53 |
Correct |
2 ms |
20836 KB |
Output is correct |
54 |
Correct |
2 ms |
20828 KB |
Output is correct |
55 |
Correct |
3 ms |
20824 KB |
Output is correct |
56 |
Correct |
2 ms |
20824 KB |
Output is correct |
57 |
Correct |
2 ms |
18776 KB |
Output is correct |
58 |
Correct |
2 ms |
20828 KB |
Output is correct |
59 |
Correct |
2 ms |
20824 KB |
Output is correct |
60 |
Correct |
2 ms |
18776 KB |
Output is correct |
61 |
Correct |
2 ms |
20828 KB |
Output is correct |
62 |
Correct |
2 ms |
20828 KB |
Output is correct |
63 |
Correct |
2 ms |
20828 KB |
Output is correct |
64 |
Correct |
3 ms |
20824 KB |
Output is correct |
65 |
Correct |
3 ms |
20824 KB |
Output is correct |
66 |
Correct |
2 ms |
20824 KB |
Output is correct |
67 |
Correct |
3 ms |
20824 KB |
Output is correct |
68 |
Correct |
2 ms |
20824 KB |
Output is correct |
69 |
Correct |
3 ms |
20824 KB |
Output is correct |
70 |
Correct |
3 ms |
20828 KB |
Output is correct |
71 |
Correct |
2 ms |
20824 KB |
Output is correct |
72 |
Correct |
3 ms |
20824 KB |
Output is correct |
73 |
Correct |
3 ms |
20828 KB |
Output is correct |
74 |
Correct |
2 ms |
20824 KB |
Output is correct |
75 |
Correct |
2 ms |
18776 KB |
Output is correct |
76 |
Correct |
2 ms |
20824 KB |
Output is correct |
77 |
Correct |
3 ms |
20824 KB |
Output is correct |
78 |
Correct |
3 ms |
18780 KB |
Output is correct |
79 |
Correct |
2 ms |
18776 KB |
Output is correct |
80 |
Correct |
3 ms |
20828 KB |
Output is correct |
81 |
Correct |
3 ms |
20824 KB |
Output is correct |
82 |
Correct |
3 ms |
20828 KB |
Output is correct |
83 |
Correct |
2 ms |
20824 KB |
Output is correct |
84 |
Correct |
3 ms |
20824 KB |
Output is correct |
85 |
Correct |
3 ms |
20824 KB |
Output is correct |
86 |
Correct |
4 ms |
20824 KB |
Output is correct |
87 |
Correct |
3 ms |
20824 KB |
Output is correct |
88 |
Correct |
4 ms |
20828 KB |
Output is correct |
89 |
Correct |
4 ms |
21080 KB |
Output is correct |
90 |
Correct |
4 ms |
21084 KB |
Output is correct |
91 |
Correct |
4 ms |
21080 KB |
Output is correct |
92 |
Correct |
4 ms |
21084 KB |
Output is correct |
93 |
Correct |
3 ms |
19032 KB |
Output is correct |
94 |
Correct |
4 ms |
21336 KB |
Output is correct |
95 |
Correct |
4 ms |
21336 KB |
Output is correct |
96 |
Correct |
3 ms |
19032 KB |
Output is correct |
97 |
Correct |
4 ms |
21080 KB |
Output is correct |
98 |
Correct |
4 ms |
21084 KB |
Output is correct |
99 |
Correct |
4 ms |
21084 KB |
Output is correct |
100 |
Correct |
4 ms |
21080 KB |
Output is correct |
101 |
Correct |
4 ms |
20824 KB |
Output is correct |
102 |
Correct |
74 ms |
23364 KB |
Output is correct |
103 |
Correct |
70 ms |
23120 KB |
Output is correct |
104 |
Correct |
187 ms |
46820 KB |
Output is correct |
105 |
Correct |
83 ms |
24144 KB |
Output is correct |
106 |
Correct |
106 ms |
23808 KB |
Output is correct |
107 |
Correct |
56 ms |
38116 KB |
Output is correct |
108 |
Correct |
59 ms |
38504 KB |
Output is correct |
109 |
Correct |
82 ms |
48764 KB |
Output is correct |
110 |
Correct |
186 ms |
41552 KB |
Output is correct |
111 |
Correct |
104 ms |
48724 KB |
Output is correct |
112 |
Correct |
181 ms |
41040 KB |
Output is correct |
113 |
Correct |
154 ms |
35568 KB |
Output is correct |
114 |
Correct |
145 ms |
41836 KB |
Output is correct |
115 |
Correct |
100 ms |
52820 KB |
Output is correct |
116 |
Correct |
173 ms |
44176 KB |
Output is correct |
117 |
Correct |
153 ms |
41040 KB |
Output is correct |
118 |
Correct |
192 ms |
41944 KB |
Output is correct |
119 |
Correct |
89 ms |
25612 KB |
Output is correct |
120 |
Correct |
74 ms |
23376 KB |
Output is correct |