# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
501204 |
2022-01-02T15:41:35 Z |
rainboy |
Wells (CEOI21_wells) |
C |
|
149 ms |
2200 KB |
#include <stdio.h>
#define N 10000
#define INF 0x3f3f3f3f3f3f3f3fLL
#define MD 1000000007
long long min(long long a, long long b) { return a < b ? a : b; }
int max(int a, int b) { return a > b ? a : b; }
int mem[(N - 1) * 2], *ptr = mem, *ej[N], eo[N], n, k;
int ll[N], jj[N], ta[N], tb[N], kk[N + 1], qu[N * 2];
void dfs1(int p, int i, int d) {
int o;
kk[d + 1]++;
ll[i] = 0, jj[i] = -1;
for (o = eo[i]; o--; ) {
int j = ej[i][o];
if (j != p) {
dfs1(i, j, d + 1);
if (ll[i] < ll[j])
ll[i] = ll[j], jj[i] = j;
}
}
ll[i]++;
}
void dfs2(int p, int i, int d) {
static int time;
int o;
qu[ta[i] = time++] = i, tb[i] = kk[d]++;
if (jj[i] != -1)
dfs2(i, jj[i], d + 1);
else
time++;
for (o = eo[i]; o--; ) {
int j = ej[i][o];
if (j != p && j != jj[i])
dfs2(i, j, d + 1);
}
}
int cnt[N * 2]; long long xx[N + 1];
void get_range(int a, int *l, int *r) {
*l = tb[qu[a]], *r = *l + cnt[a];
}
void dfs3(int p, int i) {
int o, d, l1, r1, l2, r2;
long long c;
for (o = eo[i]; o--; ) {
int j = ej[i][o];
if (j != p)
dfs3(i, j);
}
if (k <= ll[i]) {
get_range(ta[i] + k - 1, &l1, &r1);
xx[l1]++, xx[r1]--;
if (p != -1)
xx[tb[p]] -= r1 - l1, xx[tb[p] + 1] += r1 - l1;
}
cnt[ta[i]]++;
for (o = eo[i]; o--; ) {
int j = ej[i][o];
if (j != p && j != jj[i]) {
for (d = 1; d <= ll[j] && d < k; d++)
if (k - d <= ll[i]) {
get_range(ta[i] + k - d - 1, &l1, &r1), get_range(ta[j] + d - 1, &l2, &r2);
c = (long long) (r1 - l1) * (r2 - l2);
xx[l1] += r2 - l2, xx[r1] -= r2 - l2;
xx[l2] += r1 - l1, xx[r2] -= r1 - l1;
xx[tb[i]] -= c, xx[tb[i] + 1] += c;
if (p != -1)
xx[tb[p]] -= c, xx[tb[p] + 1] += c;
}
for (d = 1; d <= ll[j]; d++)
cnt[ta[i] + d] += cnt[ta[j] + d - 1];
}
}
}
long long ww[N];
void dfs4(int p, int i) {
int o;
ww[i] = xx[tb[i]];
for (o = eo[i]; o--; ) {
int j = ej[i][o];
if (j != p) {
dfs4(i, j);
ww[i] += ww[j];
}
}
}
long long dp[N * 2]; int dq[N * 2];
void update(int l, int r, long long p, int q) {
int i;
for (i = l; i <= r; i++)
dp[i] += p, dq[i] = (long long) dq[i] * q % MD;
}
void query(int l, int r, long long *p_, int *q_) {
int i;
long long p;
int q;
p = INF, q = 0;
for (i = l; i <= r; i++) {
if (p > dp[i])
p = dp[i], q = 0;
if (p == dp[i])
q = (q + dq[i]) % MD;
}
*p_ = p, *q_ = q;
}
void dfs5(int p, int i) {
int o, j, di, dj, d;
long long pi, pj, p_;
int qi, qj, q;
dp[ta[i] + 0] = ww[i], dq[ta[i] + 0] = 1;
if (jj[i] == -1)
dp[ta[i] + 1] = 0, dq[ta[i] + 1] = 1;
else {
for (o = eo[i]; o--; ) {
j = ej[i][o];
if (j != p)
dfs5(i, j);
}
j = jj[i];
query(ta[j], ta[j] + ll[j], &p_, &q);
dp[ta[i] + 0] += p_, dq[ta[i] + 0] = q;
if (ll[i] >= k)
dp[ta[i] + k] = INF, dq[ta[i] + k] = 0;
for (o = eo[i]; o--; ) {
j = ej[i][o];
if (j != p && j != jj[i]) {
query(ta[j], ta[j] + ll[j], &p_, &q);
dp[ta[i] + 0] += p_, dq[ta[i] + 0] = (long long) dq[ta[i] + 0] * q % MD;
for (di = ll[i]; di > 0; di--) {
pi = dp[ta[i] + di], qi = dq[ta[i] + di];
dp[ta[i] + di] = INF, dq[ta[i] + di] = 0;
for (dj = ll[j]; dj >= 0; dj--) {
pj = dp[ta[j] + dj], qj = dq[ta[j] + dj];
if (di + dj < k) {
d = max(di, dj + 1);
p_ = pi + pj;
q = (long long) qi * qj % MD;
if (dp[ta[i] + d] > p_)
dp[ta[i] + d] = p_, dq[ta[i] + d] = 0;
if (dp[ta[i] + d] == p_)
dq[ta[i] + d] = (dq[ta[i] + d] + q) % MD;
}
}
}
}
}
}
}
int main() {
static int uu[N - 1], vv[N - 1];
int h, i, j, d, q;
long long w, p;
scanf("%d%d", &n, &k);
for (h = 0; h < n - 1; h++) {
scanf("%d%d", &i, &j), i--, j--;
uu[h] = i, vv[h] = j;
eo[i]++, eo[j]++;
}
for (i = 0; i < n; i++) {
ej[i] = ptr, ptr += eo[i];
eo[i] = 0;
}
for (h = 0; h < n - 1; h++) {
i = uu[h], j = vv[h];
ej[i][eo[i]++] = j, ej[j][eo[j]++] = i;
}
dfs1(-1, 0, 0);
for (d = 1; d <= n; d++)
kk[d] += kk[d - 1];
dfs2(-1, 0, 0);
dfs3(-1, 0);
for (i = 1; i <= n; i++)
xx[i] += xx[i - 1];
dfs4(-1, 0);
w = 0;
for (i = 0; i < n; i++)
w += ww[i];
w /= k;
dfs5(-1, 0);
query(ta[0], ta[0] + ll[0], &p, &q);
if (p == w)
printf("YES\n%d\n", q);
else
printf("NO\n0\n");
return 0;
}
Compilation message
wells.c: In function 'main':
wells.c:181:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
181 | scanf("%d%d", &n, &k);
| ^~~~~~~~~~~~~~~~~~~~~
wells.c:183:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
183 | scanf("%d%d", &i, &j), i--, j--;
| ^~~~~~~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
332 KB |
Output is correct |
2 |
Correct |
0 ms |
332 KB |
Output is correct |
3 |
Correct |
0 ms |
332 KB |
Output is correct |
4 |
Correct |
0 ms |
332 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
0 ms |
332 KB |
Output is correct |
7 |
Correct |
1 ms |
332 KB |
Output is correct |
8 |
Correct |
0 ms |
332 KB |
Output is correct |
9 |
Correct |
0 ms |
332 KB |
Output is correct |
10 |
Correct |
0 ms |
332 KB |
Output is correct |
11 |
Correct |
0 ms |
332 KB |
Output is correct |
12 |
Correct |
0 ms |
332 KB |
Output is correct |
13 |
Correct |
0 ms |
332 KB |
Output is correct |
14 |
Correct |
0 ms |
280 KB |
Output is correct |
15 |
Correct |
1 ms |
280 KB |
Output is correct |
16 |
Correct |
1 ms |
332 KB |
Output is correct |
17 |
Correct |
1 ms |
276 KB |
Output is correct |
18 |
Correct |
1 ms |
332 KB |
Output is correct |
19 |
Correct |
0 ms |
332 KB |
Output is correct |
20 |
Correct |
0 ms |
332 KB |
Output is correct |
21 |
Correct |
1 ms |
332 KB |
Output is correct |
22 |
Correct |
0 ms |
332 KB |
Output is correct |
23 |
Correct |
1 ms |
332 KB |
Output is correct |
24 |
Correct |
0 ms |
332 KB |
Output is correct |
25 |
Correct |
1 ms |
332 KB |
Output is correct |
26 |
Correct |
1 ms |
352 KB |
Output is correct |
27 |
Correct |
1 ms |
332 KB |
Output is correct |
28 |
Correct |
1 ms |
332 KB |
Output is correct |
29 |
Correct |
0 ms |
332 KB |
Output is correct |
30 |
Correct |
0 ms |
332 KB |
Output is correct |
31 |
Correct |
0 ms |
332 KB |
Output is correct |
32 |
Correct |
0 ms |
332 KB |
Output is correct |
33 |
Correct |
1 ms |
332 KB |
Output is correct |
34 |
Correct |
0 ms |
332 KB |
Output is correct |
35 |
Correct |
0 ms |
332 KB |
Output is correct |
36 |
Correct |
0 ms |
332 KB |
Output is correct |
37 |
Correct |
1 ms |
332 KB |
Output is correct |
38 |
Correct |
1 ms |
332 KB |
Output is correct |
39 |
Correct |
1 ms |
332 KB |
Output is correct |
40 |
Correct |
1 ms |
332 KB |
Output is correct |
41 |
Correct |
1 ms |
332 KB |
Output is correct |
42 |
Correct |
0 ms |
332 KB |
Output is correct |
43 |
Correct |
1 ms |
332 KB |
Output is correct |
44 |
Correct |
0 ms |
332 KB |
Output is correct |
45 |
Correct |
0 ms |
332 KB |
Output is correct |
46 |
Correct |
0 ms |
332 KB |
Output is correct |
47 |
Correct |
1 ms |
332 KB |
Output is correct |
48 |
Correct |
0 ms |
332 KB |
Output is correct |
49 |
Correct |
1 ms |
332 KB |
Output is correct |
50 |
Correct |
0 ms |
332 KB |
Output is correct |
51 |
Correct |
1 ms |
332 KB |
Output is correct |
52 |
Correct |
0 ms |
332 KB |
Output is correct |
53 |
Correct |
0 ms |
332 KB |
Output is correct |
54 |
Correct |
1 ms |
332 KB |
Output is correct |
55 |
Correct |
0 ms |
332 KB |
Output is correct |
56 |
Correct |
0 ms |
332 KB |
Output is correct |
57 |
Correct |
1 ms |
332 KB |
Output is correct |
58 |
Correct |
1 ms |
332 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
332 KB |
Output is correct |
2 |
Correct |
0 ms |
332 KB |
Output is correct |
3 |
Correct |
0 ms |
332 KB |
Output is correct |
4 |
Correct |
0 ms |
332 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
0 ms |
332 KB |
Output is correct |
7 |
Correct |
1 ms |
332 KB |
Output is correct |
8 |
Correct |
0 ms |
332 KB |
Output is correct |
9 |
Correct |
0 ms |
332 KB |
Output is correct |
10 |
Correct |
0 ms |
332 KB |
Output is correct |
11 |
Correct |
0 ms |
332 KB |
Output is correct |
12 |
Correct |
0 ms |
332 KB |
Output is correct |
13 |
Correct |
0 ms |
332 KB |
Output is correct |
14 |
Correct |
0 ms |
280 KB |
Output is correct |
15 |
Correct |
1 ms |
280 KB |
Output is correct |
16 |
Correct |
1 ms |
332 KB |
Output is correct |
17 |
Correct |
1 ms |
276 KB |
Output is correct |
18 |
Correct |
1 ms |
332 KB |
Output is correct |
19 |
Correct |
0 ms |
332 KB |
Output is correct |
20 |
Correct |
0 ms |
332 KB |
Output is correct |
21 |
Correct |
1 ms |
332 KB |
Output is correct |
22 |
Correct |
0 ms |
332 KB |
Output is correct |
23 |
Correct |
1 ms |
332 KB |
Output is correct |
24 |
Correct |
0 ms |
332 KB |
Output is correct |
25 |
Correct |
1 ms |
332 KB |
Output is correct |
26 |
Correct |
1 ms |
352 KB |
Output is correct |
27 |
Correct |
1 ms |
332 KB |
Output is correct |
28 |
Correct |
1 ms |
332 KB |
Output is correct |
29 |
Correct |
0 ms |
332 KB |
Output is correct |
30 |
Correct |
0 ms |
332 KB |
Output is correct |
31 |
Correct |
0 ms |
332 KB |
Output is correct |
32 |
Correct |
0 ms |
332 KB |
Output is correct |
33 |
Correct |
1 ms |
332 KB |
Output is correct |
34 |
Correct |
0 ms |
332 KB |
Output is correct |
35 |
Correct |
0 ms |
332 KB |
Output is correct |
36 |
Correct |
0 ms |
332 KB |
Output is correct |
37 |
Correct |
1 ms |
332 KB |
Output is correct |
38 |
Correct |
1 ms |
332 KB |
Output is correct |
39 |
Correct |
1 ms |
332 KB |
Output is correct |
40 |
Correct |
1 ms |
332 KB |
Output is correct |
41 |
Correct |
1 ms |
332 KB |
Output is correct |
42 |
Correct |
0 ms |
332 KB |
Output is correct |
43 |
Correct |
1 ms |
332 KB |
Output is correct |
44 |
Correct |
0 ms |
332 KB |
Output is correct |
45 |
Correct |
0 ms |
332 KB |
Output is correct |
46 |
Correct |
0 ms |
332 KB |
Output is correct |
47 |
Correct |
1 ms |
332 KB |
Output is correct |
48 |
Correct |
0 ms |
332 KB |
Output is correct |
49 |
Correct |
1 ms |
332 KB |
Output is correct |
50 |
Correct |
0 ms |
332 KB |
Output is correct |
51 |
Correct |
1 ms |
332 KB |
Output is correct |
52 |
Correct |
0 ms |
332 KB |
Output is correct |
53 |
Correct |
0 ms |
332 KB |
Output is correct |
54 |
Correct |
1 ms |
332 KB |
Output is correct |
55 |
Correct |
0 ms |
332 KB |
Output is correct |
56 |
Correct |
0 ms |
332 KB |
Output is correct |
57 |
Correct |
1 ms |
332 KB |
Output is correct |
58 |
Correct |
1 ms |
332 KB |
Output is correct |
59 |
Correct |
0 ms |
284 KB |
Output is correct |
60 |
Correct |
6 ms |
668 KB |
Output is correct |
61 |
Correct |
3 ms |
588 KB |
Output is correct |
62 |
Correct |
5 ms |
728 KB |
Output is correct |
63 |
Correct |
22 ms |
1320 KB |
Output is correct |
64 |
Correct |
58 ms |
2180 KB |
Output is correct |
65 |
Correct |
7 ms |
1232 KB |
Output is correct |
66 |
Correct |
6 ms |
1248 KB |
Output is correct |
67 |
Correct |
66 ms |
2200 KB |
Output is correct |
68 |
Correct |
7 ms |
804 KB |
Output is correct |
69 |
Correct |
2 ms |
728 KB |
Output is correct |
70 |
Correct |
47 ms |
1440 KB |
Output is correct |
71 |
Correct |
6 ms |
844 KB |
Output is correct |
72 |
Correct |
9 ms |
844 KB |
Output is correct |
73 |
Correct |
27 ms |
972 KB |
Output is correct |
74 |
Correct |
90 ms |
1692 KB |
Output is correct |
75 |
Correct |
41 ms |
1424 KB |
Output is correct |
76 |
Correct |
63 ms |
1412 KB |
Output is correct |
77 |
Correct |
5 ms |
716 KB |
Output is correct |
78 |
Correct |
18 ms |
844 KB |
Output is correct |
79 |
Correct |
5 ms |
732 KB |
Output is correct |
80 |
Correct |
48 ms |
1396 KB |
Output is correct |
81 |
Correct |
90 ms |
1516 KB |
Output is correct |
82 |
Correct |
59 ms |
1348 KB |
Output is correct |
83 |
Correct |
84 ms |
1536 KB |
Output is correct |
84 |
Correct |
22 ms |
1424 KB |
Output is correct |
85 |
Correct |
149 ms |
1848 KB |
Output is correct |
86 |
Correct |
46 ms |
1404 KB |
Output is correct |
87 |
Correct |
32 ms |
1468 KB |
Output is correct |
88 |
Correct |
28 ms |
1400 KB |
Output is correct |
89 |
Correct |
11 ms |
1276 KB |
Output is correct |
90 |
Correct |
19 ms |
828 KB |
Output is correct |
91 |
Correct |
38 ms |
1360 KB |
Output is correct |
92 |
Correct |
62 ms |
1604 KB |
Output is correct |
93 |
Correct |
19 ms |
1568 KB |
Output is correct |
94 |
Correct |
6 ms |
1228 KB |
Output is correct |
95 |
Correct |
12 ms |
1180 KB |
Output is correct |
96 |
Correct |
12 ms |
840 KB |
Output is correct |
97 |
Correct |
19 ms |
1012 KB |
Output is correct |
98 |
Correct |
40 ms |
1220 KB |
Output is correct |
99 |
Correct |
22 ms |
1064 KB |
Output is correct |
100 |
Correct |
83 ms |
1556 KB |
Output is correct |
101 |
Correct |
28 ms |
1348 KB |
Output is correct |
102 |
Correct |
51 ms |
1584 KB |
Output is correct |
103 |
Correct |
50 ms |
1444 KB |
Output is correct |
104 |
Correct |
26 ms |
1428 KB |
Output is correct |
105 |
Correct |
29 ms |
1484 KB |
Output is correct |
106 |
Correct |
6 ms |
1092 KB |
Output is correct |
107 |
Correct |
39 ms |
1736 KB |
Output is correct |
108 |
Correct |
12 ms |
1180 KB |
Output is correct |
109 |
Correct |
10 ms |
1228 KB |
Output is correct |
110 |
Correct |
25 ms |
1484 KB |
Output is correct |
111 |
Correct |
42 ms |
1448 KB |
Output is correct |
112 |
Correct |
58 ms |
1616 KB |
Output is correct |
113 |
Correct |
34 ms |
1452 KB |
Output is correct |
114 |
Correct |
52 ms |
1592 KB |
Output is correct |
115 |
Correct |
18 ms |
1380 KB |
Output is correct |
116 |
Correct |
53 ms |
1628 KB |
Output is correct |
117 |
Correct |
30 ms |
1564 KB |
Output is correct |
118 |
Correct |
108 ms |
1884 KB |
Output is correct |
119 |
Correct |
36 ms |
1356 KB |
Output is correct |
120 |
Correct |
82 ms |
1612 KB |
Output is correct |
121 |
Correct |
116 ms |
1564 KB |
Output is correct |
122 |
Correct |
114 ms |
1612 KB |
Output is correct |
123 |
Correct |
23 ms |
1356 KB |
Output is correct |
124 |
Correct |
57 ms |
1548 KB |
Output is correct |
125 |
Correct |
38 ms |
1412 KB |
Output is correct |
126 |
Correct |
10 ms |
1228 KB |
Output is correct |
127 |
Correct |
62 ms |
1740 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
332 KB |
Output is correct |
2 |
Correct |
0 ms |
332 KB |
Output is correct |
3 |
Correct |
0 ms |
332 KB |
Output is correct |
4 |
Correct |
0 ms |
332 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
0 ms |
332 KB |
Output is correct |
7 |
Correct |
1 ms |
332 KB |
Output is correct |
8 |
Correct |
0 ms |
332 KB |
Output is correct |
9 |
Correct |
0 ms |
332 KB |
Output is correct |
10 |
Correct |
0 ms |
332 KB |
Output is correct |
11 |
Correct |
0 ms |
332 KB |
Output is correct |
12 |
Correct |
0 ms |
332 KB |
Output is correct |
13 |
Correct |
0 ms |
332 KB |
Output is correct |
14 |
Correct |
0 ms |
280 KB |
Output is correct |
15 |
Correct |
1 ms |
280 KB |
Output is correct |
16 |
Correct |
1 ms |
332 KB |
Output is correct |
17 |
Correct |
1 ms |
276 KB |
Output is correct |
18 |
Correct |
1 ms |
332 KB |
Output is correct |
19 |
Correct |
0 ms |
332 KB |
Output is correct |
20 |
Correct |
0 ms |
332 KB |
Output is correct |
21 |
Correct |
1 ms |
332 KB |
Output is correct |
22 |
Correct |
0 ms |
332 KB |
Output is correct |
23 |
Correct |
1 ms |
332 KB |
Output is correct |
24 |
Correct |
0 ms |
332 KB |
Output is correct |
25 |
Correct |
1 ms |
332 KB |
Output is correct |
26 |
Correct |
1 ms |
352 KB |
Output is correct |
27 |
Correct |
1 ms |
332 KB |
Output is correct |
28 |
Correct |
1 ms |
332 KB |
Output is correct |
29 |
Correct |
0 ms |
332 KB |
Output is correct |
30 |
Correct |
0 ms |
332 KB |
Output is correct |
31 |
Correct |
0 ms |
332 KB |
Output is correct |
32 |
Correct |
0 ms |
332 KB |
Output is correct |
33 |
Correct |
1 ms |
332 KB |
Output is correct |
34 |
Correct |
0 ms |
332 KB |
Output is correct |
35 |
Correct |
0 ms |
332 KB |
Output is correct |
36 |
Correct |
0 ms |
332 KB |
Output is correct |
37 |
Correct |
1 ms |
332 KB |
Output is correct |
38 |
Correct |
1 ms |
332 KB |
Output is correct |
39 |
Correct |
1 ms |
332 KB |
Output is correct |
40 |
Correct |
1 ms |
332 KB |
Output is correct |
41 |
Correct |
1 ms |
332 KB |
Output is correct |
42 |
Correct |
0 ms |
332 KB |
Output is correct |
43 |
Correct |
1 ms |
332 KB |
Output is correct |
44 |
Correct |
0 ms |
332 KB |
Output is correct |
45 |
Correct |
0 ms |
332 KB |
Output is correct |
46 |
Correct |
0 ms |
332 KB |
Output is correct |
47 |
Correct |
1 ms |
332 KB |
Output is correct |
48 |
Correct |
0 ms |
332 KB |
Output is correct |
49 |
Correct |
1 ms |
332 KB |
Output is correct |
50 |
Correct |
0 ms |
332 KB |
Output is correct |
51 |
Correct |
1 ms |
332 KB |
Output is correct |
52 |
Correct |
0 ms |
332 KB |
Output is correct |
53 |
Correct |
0 ms |
332 KB |
Output is correct |
54 |
Correct |
1 ms |
332 KB |
Output is correct |
55 |
Correct |
0 ms |
332 KB |
Output is correct |
56 |
Correct |
0 ms |
332 KB |
Output is correct |
57 |
Correct |
1 ms |
332 KB |
Output is correct |
58 |
Correct |
1 ms |
332 KB |
Output is correct |
59 |
Correct |
0 ms |
284 KB |
Output is correct |
60 |
Correct |
6 ms |
668 KB |
Output is correct |
61 |
Correct |
3 ms |
588 KB |
Output is correct |
62 |
Correct |
5 ms |
728 KB |
Output is correct |
63 |
Correct |
22 ms |
1320 KB |
Output is correct |
64 |
Correct |
58 ms |
2180 KB |
Output is correct |
65 |
Correct |
7 ms |
1232 KB |
Output is correct |
66 |
Correct |
6 ms |
1248 KB |
Output is correct |
67 |
Correct |
66 ms |
2200 KB |
Output is correct |
68 |
Correct |
7 ms |
804 KB |
Output is correct |
69 |
Correct |
2 ms |
728 KB |
Output is correct |
70 |
Correct |
47 ms |
1440 KB |
Output is correct |
71 |
Correct |
6 ms |
844 KB |
Output is correct |
72 |
Correct |
9 ms |
844 KB |
Output is correct |
73 |
Correct |
27 ms |
972 KB |
Output is correct |
74 |
Correct |
90 ms |
1692 KB |
Output is correct |
75 |
Correct |
41 ms |
1424 KB |
Output is correct |
76 |
Correct |
63 ms |
1412 KB |
Output is correct |
77 |
Correct |
5 ms |
716 KB |
Output is correct |
78 |
Correct |
18 ms |
844 KB |
Output is correct |
79 |
Correct |
5 ms |
732 KB |
Output is correct |
80 |
Correct |
48 ms |
1396 KB |
Output is correct |
81 |
Correct |
90 ms |
1516 KB |
Output is correct |
82 |
Correct |
59 ms |
1348 KB |
Output is correct |
83 |
Correct |
84 ms |
1536 KB |
Output is correct |
84 |
Correct |
22 ms |
1424 KB |
Output is correct |
85 |
Correct |
149 ms |
1848 KB |
Output is correct |
86 |
Correct |
46 ms |
1404 KB |
Output is correct |
87 |
Correct |
32 ms |
1468 KB |
Output is correct |
88 |
Correct |
28 ms |
1400 KB |
Output is correct |
89 |
Correct |
11 ms |
1276 KB |
Output is correct |
90 |
Correct |
19 ms |
828 KB |
Output is correct |
91 |
Correct |
38 ms |
1360 KB |
Output is correct |
92 |
Correct |
62 ms |
1604 KB |
Output is correct |
93 |
Correct |
19 ms |
1568 KB |
Output is correct |
94 |
Correct |
6 ms |
1228 KB |
Output is correct |
95 |
Correct |
12 ms |
1180 KB |
Output is correct |
96 |
Correct |
12 ms |
840 KB |
Output is correct |
97 |
Correct |
19 ms |
1012 KB |
Output is correct |
98 |
Correct |
40 ms |
1220 KB |
Output is correct |
99 |
Correct |
22 ms |
1064 KB |
Output is correct |
100 |
Correct |
83 ms |
1556 KB |
Output is correct |
101 |
Correct |
28 ms |
1348 KB |
Output is correct |
102 |
Correct |
51 ms |
1584 KB |
Output is correct |
103 |
Correct |
50 ms |
1444 KB |
Output is correct |
104 |
Correct |
26 ms |
1428 KB |
Output is correct |
105 |
Correct |
29 ms |
1484 KB |
Output is correct |
106 |
Correct |
6 ms |
1092 KB |
Output is correct |
107 |
Correct |
39 ms |
1736 KB |
Output is correct |
108 |
Correct |
12 ms |
1180 KB |
Output is correct |
109 |
Correct |
10 ms |
1228 KB |
Output is correct |
110 |
Correct |
25 ms |
1484 KB |
Output is correct |
111 |
Correct |
42 ms |
1448 KB |
Output is correct |
112 |
Correct |
58 ms |
1616 KB |
Output is correct |
113 |
Correct |
34 ms |
1452 KB |
Output is correct |
114 |
Correct |
52 ms |
1592 KB |
Output is correct |
115 |
Correct |
18 ms |
1380 KB |
Output is correct |
116 |
Correct |
53 ms |
1628 KB |
Output is correct |
117 |
Correct |
30 ms |
1564 KB |
Output is correct |
118 |
Correct |
108 ms |
1884 KB |
Output is correct |
119 |
Correct |
36 ms |
1356 KB |
Output is correct |
120 |
Correct |
82 ms |
1612 KB |
Output is correct |
121 |
Correct |
116 ms |
1564 KB |
Output is correct |
122 |
Correct |
114 ms |
1612 KB |
Output is correct |
123 |
Correct |
23 ms |
1356 KB |
Output is correct |
124 |
Correct |
57 ms |
1548 KB |
Output is correct |
125 |
Correct |
38 ms |
1412 KB |
Output is correct |
126 |
Correct |
10 ms |
1228 KB |
Output is correct |
127 |
Correct |
62 ms |
1740 KB |
Output is correct |
128 |
Correct |
0 ms |
332 KB |
Output is correct |
129 |
Runtime error |
1 ms |
332 KB |
Execution killed with signal 11 |
130 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
332 KB |
Output is correct |
2 |
Correct |
0 ms |
332 KB |
Output is correct |
3 |
Correct |
0 ms |
332 KB |
Output is correct |
4 |
Correct |
0 ms |
332 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
0 ms |
332 KB |
Output is correct |
7 |
Correct |
1 ms |
332 KB |
Output is correct |
8 |
Correct |
0 ms |
332 KB |
Output is correct |
9 |
Correct |
0 ms |
332 KB |
Output is correct |
10 |
Correct |
0 ms |
332 KB |
Output is correct |
11 |
Correct |
0 ms |
332 KB |
Output is correct |
12 |
Correct |
0 ms |
332 KB |
Output is correct |
13 |
Correct |
0 ms |
332 KB |
Output is correct |
14 |
Correct |
0 ms |
280 KB |
Output is correct |
15 |
Correct |
1 ms |
280 KB |
Output is correct |
16 |
Correct |
1 ms |
332 KB |
Output is correct |
17 |
Correct |
1 ms |
276 KB |
Output is correct |
18 |
Correct |
1 ms |
332 KB |
Output is correct |
19 |
Correct |
0 ms |
332 KB |
Output is correct |
20 |
Correct |
0 ms |
332 KB |
Output is correct |
21 |
Correct |
1 ms |
332 KB |
Output is correct |
22 |
Correct |
0 ms |
332 KB |
Output is correct |
23 |
Correct |
1 ms |
332 KB |
Output is correct |
24 |
Correct |
0 ms |
332 KB |
Output is correct |
25 |
Correct |
1 ms |
332 KB |
Output is correct |
26 |
Correct |
1 ms |
352 KB |
Output is correct |
27 |
Correct |
1 ms |
332 KB |
Output is correct |
28 |
Correct |
1 ms |
332 KB |
Output is correct |
29 |
Correct |
0 ms |
332 KB |
Output is correct |
30 |
Correct |
0 ms |
332 KB |
Output is correct |
31 |
Correct |
0 ms |
332 KB |
Output is correct |
32 |
Correct |
0 ms |
332 KB |
Output is correct |
33 |
Correct |
1 ms |
332 KB |
Output is correct |
34 |
Correct |
0 ms |
332 KB |
Output is correct |
35 |
Correct |
0 ms |
332 KB |
Output is correct |
36 |
Correct |
0 ms |
332 KB |
Output is correct |
37 |
Correct |
1 ms |
332 KB |
Output is correct |
38 |
Correct |
1 ms |
332 KB |
Output is correct |
39 |
Correct |
1 ms |
332 KB |
Output is correct |
40 |
Correct |
1 ms |
332 KB |
Output is correct |
41 |
Correct |
1 ms |
332 KB |
Output is correct |
42 |
Correct |
0 ms |
332 KB |
Output is correct |
43 |
Correct |
1 ms |
332 KB |
Output is correct |
44 |
Correct |
0 ms |
332 KB |
Output is correct |
45 |
Correct |
0 ms |
332 KB |
Output is correct |
46 |
Correct |
0 ms |
332 KB |
Output is correct |
47 |
Correct |
1 ms |
332 KB |
Output is correct |
48 |
Correct |
0 ms |
332 KB |
Output is correct |
49 |
Correct |
1 ms |
332 KB |
Output is correct |
50 |
Correct |
0 ms |
332 KB |
Output is correct |
51 |
Correct |
1 ms |
332 KB |
Output is correct |
52 |
Correct |
0 ms |
332 KB |
Output is correct |
53 |
Correct |
0 ms |
332 KB |
Output is correct |
54 |
Correct |
1 ms |
332 KB |
Output is correct |
55 |
Correct |
0 ms |
332 KB |
Output is correct |
56 |
Correct |
0 ms |
332 KB |
Output is correct |
57 |
Correct |
1 ms |
332 KB |
Output is correct |
58 |
Correct |
1 ms |
332 KB |
Output is correct |
59 |
Correct |
0 ms |
284 KB |
Output is correct |
60 |
Correct |
6 ms |
668 KB |
Output is correct |
61 |
Correct |
3 ms |
588 KB |
Output is correct |
62 |
Correct |
5 ms |
728 KB |
Output is correct |
63 |
Correct |
22 ms |
1320 KB |
Output is correct |
64 |
Correct |
58 ms |
2180 KB |
Output is correct |
65 |
Correct |
7 ms |
1232 KB |
Output is correct |
66 |
Correct |
6 ms |
1248 KB |
Output is correct |
67 |
Correct |
66 ms |
2200 KB |
Output is correct |
68 |
Correct |
7 ms |
804 KB |
Output is correct |
69 |
Correct |
2 ms |
728 KB |
Output is correct |
70 |
Correct |
47 ms |
1440 KB |
Output is correct |
71 |
Correct |
6 ms |
844 KB |
Output is correct |
72 |
Correct |
9 ms |
844 KB |
Output is correct |
73 |
Correct |
27 ms |
972 KB |
Output is correct |
74 |
Correct |
90 ms |
1692 KB |
Output is correct |
75 |
Correct |
41 ms |
1424 KB |
Output is correct |
76 |
Correct |
63 ms |
1412 KB |
Output is correct |
77 |
Correct |
5 ms |
716 KB |
Output is correct |
78 |
Correct |
18 ms |
844 KB |
Output is correct |
79 |
Correct |
5 ms |
732 KB |
Output is correct |
80 |
Correct |
48 ms |
1396 KB |
Output is correct |
81 |
Correct |
90 ms |
1516 KB |
Output is correct |
82 |
Correct |
59 ms |
1348 KB |
Output is correct |
83 |
Correct |
84 ms |
1536 KB |
Output is correct |
84 |
Correct |
22 ms |
1424 KB |
Output is correct |
85 |
Correct |
149 ms |
1848 KB |
Output is correct |
86 |
Correct |
46 ms |
1404 KB |
Output is correct |
87 |
Correct |
32 ms |
1468 KB |
Output is correct |
88 |
Correct |
28 ms |
1400 KB |
Output is correct |
89 |
Correct |
11 ms |
1276 KB |
Output is correct |
90 |
Correct |
19 ms |
828 KB |
Output is correct |
91 |
Correct |
38 ms |
1360 KB |
Output is correct |
92 |
Correct |
62 ms |
1604 KB |
Output is correct |
93 |
Correct |
19 ms |
1568 KB |
Output is correct |
94 |
Correct |
6 ms |
1228 KB |
Output is correct |
95 |
Correct |
12 ms |
1180 KB |
Output is correct |
96 |
Correct |
12 ms |
840 KB |
Output is correct |
97 |
Correct |
19 ms |
1012 KB |
Output is correct |
98 |
Correct |
40 ms |
1220 KB |
Output is correct |
99 |
Correct |
22 ms |
1064 KB |
Output is correct |
100 |
Correct |
83 ms |
1556 KB |
Output is correct |
101 |
Correct |
28 ms |
1348 KB |
Output is correct |
102 |
Correct |
51 ms |
1584 KB |
Output is correct |
103 |
Correct |
50 ms |
1444 KB |
Output is correct |
104 |
Correct |
26 ms |
1428 KB |
Output is correct |
105 |
Correct |
29 ms |
1484 KB |
Output is correct |
106 |
Correct |
6 ms |
1092 KB |
Output is correct |
107 |
Correct |
39 ms |
1736 KB |
Output is correct |
108 |
Correct |
12 ms |
1180 KB |
Output is correct |
109 |
Correct |
10 ms |
1228 KB |
Output is correct |
110 |
Correct |
25 ms |
1484 KB |
Output is correct |
111 |
Correct |
42 ms |
1448 KB |
Output is correct |
112 |
Correct |
58 ms |
1616 KB |
Output is correct |
113 |
Correct |
34 ms |
1452 KB |
Output is correct |
114 |
Correct |
52 ms |
1592 KB |
Output is correct |
115 |
Correct |
18 ms |
1380 KB |
Output is correct |
116 |
Correct |
53 ms |
1628 KB |
Output is correct |
117 |
Correct |
30 ms |
1564 KB |
Output is correct |
118 |
Correct |
108 ms |
1884 KB |
Output is correct |
119 |
Correct |
36 ms |
1356 KB |
Output is correct |
120 |
Correct |
82 ms |
1612 KB |
Output is correct |
121 |
Correct |
116 ms |
1564 KB |
Output is correct |
122 |
Correct |
114 ms |
1612 KB |
Output is correct |
123 |
Correct |
23 ms |
1356 KB |
Output is correct |
124 |
Correct |
57 ms |
1548 KB |
Output is correct |
125 |
Correct |
38 ms |
1412 KB |
Output is correct |
126 |
Correct |
10 ms |
1228 KB |
Output is correct |
127 |
Correct |
62 ms |
1740 KB |
Output is correct |
128 |
Correct |
0 ms |
332 KB |
Output is correct |
129 |
Runtime error |
1 ms |
332 KB |
Execution killed with signal 11 |
130 |
Halted |
0 ms |
0 KB |
- |