# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
500992 |
2022-01-01T22:09:52 Z |
rainboy |
Wells (CEOI21_wells) |
C |
|
2588 ms |
503640 KB |
#include <stdio.h>
#include <stdlib.h>
#include <string.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 *ej[N], eo[N], n, k;
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 ww[N];
int dfs1(int p, int i, int d) {
int o, w;
if (--d == 0) {
ww[i]++;
return 1;
}
w = 0;
for (o = eo[i]; o--; ) {
int j = ej[i][o];
if (j != p)
w += dfs1(i, j, d);
}
ww[i] += w;
return w;
}
long long dp[N][N + 1]; int dq[N][N + 1], sz[N + 1];
void dfs2(int p, int i) {
int o, di, dj;
dp[i][0] = ww[i], dq[i][0] = 1, dp[i][1] = 0, dq[i][1] = 1, sz[i] = 1;
for (o = eo[i]; o--; ) {
int j = ej[i][o];
if (j != p) {
dfs2(i, j);
memset(dp[i] + sz[i] + 1, 0x3f, sz[j] * sizeof *dp[i]);
memset(dq[i] + sz[i] + 1, 0, sz[j] * sizeof *dq[i]);
for (di = sz[i]; di >= 0; di--) {
long long pi = dp[i][di];
int qi = dq[i][di];
dp[i][di] = INF, dq[i][di] = 0;
for (dj = sz[j]; dj >= 0; dj--) {
long long pj = dp[j][dj];
int qj = dq[j][dj];
if (di + dj < k) {
int d = di == 0 ? 0 : max(di, dj + 1);
long long p = pi + pj;
int q = (long long) qi * qj % MD;
if (dp[i][d] > p)
dp[i][d] = p, dq[i][d] = 0;
if (dp[i][d] == p)
dq[i][d] = (dq[i][d] + q) % MD;
}
}
}
sz[i] += sz[j];
}
}
}
int main() {
int h, i, j, d, yes, q;
long long w;
scanf("%d%d", &n, &k);
for (i = 0; i < n; i++)
ej[i] = (int *) malloc(2 * sizeof *ej[i]);
for (h = 0; h < n - 1; h++) {
scanf("%d%d", &i, &j), i--, j--;
append(i, j), append(j, i);
}
for (i = 0; i < n; i++)
dfs1(-1, i, k);
w = 0;
for (i = 0; i < n; i++)
w += ww[i] /= 2;
w /= k;
dfs2(-1, 0);
yes = 0, q = 0;
for (d = 0; d < n; d++)
if (dp[0][d] == w)
yes = 1, q = (q + dq[0][d]) % MD;
printf(yes ? "YES\n" : "NO\n");
printf("%d\n", q);
return 0;
}
Compilation message
wells.c: In function 'append':
wells.c:17:23: warning: suggest parentheses around '-' in operand of '&' [-Wparentheses]
17 | if (o >= 2 && (o & o - 1) == 0)
| ~~^~~
wells.c: In function 'main':
wells.c:85:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
85 | scanf("%d%d", &n, &k);
| ^~~~~~~~~~~~~~~~~~~~~
wells.c:89:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
89 | scanf("%d%d", &i, &j), i--, j--;
| ^~~~~~~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
1996 KB |
Output is correct |
3 |
Correct |
2 ms |
1996 KB |
Output is correct |
4 |
Correct |
1 ms |
1996 KB |
Output is correct |
5 |
Correct |
1 ms |
1996 KB |
Output is correct |
6 |
Correct |
1 ms |
1996 KB |
Output is correct |
7 |
Correct |
1 ms |
1996 KB |
Output is correct |
8 |
Correct |
1 ms |
1996 KB |
Output is correct |
9 |
Correct |
1 ms |
1996 KB |
Output is correct |
10 |
Correct |
1 ms |
1996 KB |
Output is correct |
11 |
Correct |
1 ms |
1996 KB |
Output is correct |
12 |
Correct |
1 ms |
1996 KB |
Output is correct |
13 |
Correct |
1 ms |
1996 KB |
Output is correct |
14 |
Correct |
1 ms |
1996 KB |
Output is correct |
15 |
Correct |
1 ms |
1996 KB |
Output is correct |
16 |
Correct |
1 ms |
1996 KB |
Output is correct |
17 |
Correct |
1 ms |
1996 KB |
Output is correct |
18 |
Correct |
1 ms |
1996 KB |
Output is correct |
19 |
Correct |
1 ms |
1940 KB |
Output is correct |
20 |
Correct |
1 ms |
1996 KB |
Output is correct |
21 |
Correct |
1 ms |
1996 KB |
Output is correct |
22 |
Correct |
1 ms |
1996 KB |
Output is correct |
23 |
Correct |
2 ms |
1996 KB |
Output is correct |
24 |
Correct |
1 ms |
1996 KB |
Output is correct |
25 |
Correct |
1 ms |
1996 KB |
Output is correct |
26 |
Correct |
1 ms |
1996 KB |
Output is correct |
27 |
Correct |
1 ms |
1996 KB |
Output is correct |
28 |
Correct |
1 ms |
1996 KB |
Output is correct |
29 |
Correct |
1 ms |
1996 KB |
Output is correct |
30 |
Correct |
1 ms |
1996 KB |
Output is correct |
31 |
Correct |
1 ms |
1868 KB |
Output is correct |
32 |
Correct |
1 ms |
1996 KB |
Output is correct |
33 |
Correct |
1 ms |
1996 KB |
Output is correct |
34 |
Correct |
1 ms |
1996 KB |
Output is correct |
35 |
Correct |
1 ms |
1868 KB |
Output is correct |
36 |
Correct |
1 ms |
1996 KB |
Output is correct |
37 |
Correct |
1 ms |
1996 KB |
Output is correct |
38 |
Correct |
1 ms |
1996 KB |
Output is correct |
39 |
Correct |
1 ms |
1996 KB |
Output is correct |
40 |
Correct |
1 ms |
1996 KB |
Output is correct |
41 |
Correct |
1 ms |
1996 KB |
Output is correct |
42 |
Correct |
1 ms |
1868 KB |
Output is correct |
43 |
Correct |
2 ms |
1996 KB |
Output is correct |
44 |
Correct |
1 ms |
1996 KB |
Output is correct |
45 |
Correct |
1 ms |
1996 KB |
Output is correct |
46 |
Correct |
1 ms |
1996 KB |
Output is correct |
47 |
Correct |
1 ms |
1996 KB |
Output is correct |
48 |
Correct |
1 ms |
1996 KB |
Output is correct |
49 |
Correct |
1 ms |
1996 KB |
Output is correct |
50 |
Correct |
2 ms |
1996 KB |
Output is correct |
51 |
Correct |
1 ms |
1996 KB |
Output is correct |
52 |
Correct |
1 ms |
1996 KB |
Output is correct |
53 |
Correct |
1 ms |
1996 KB |
Output is correct |
54 |
Correct |
1 ms |
1996 KB |
Output is correct |
55 |
Correct |
1 ms |
1932 KB |
Output is correct |
56 |
Correct |
1 ms |
1996 KB |
Output is correct |
57 |
Correct |
1 ms |
1972 KB |
Output is correct |
58 |
Correct |
1 ms |
1996 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
1996 KB |
Output is correct |
3 |
Correct |
2 ms |
1996 KB |
Output is correct |
4 |
Correct |
1 ms |
1996 KB |
Output is correct |
5 |
Correct |
1 ms |
1996 KB |
Output is correct |
6 |
Correct |
1 ms |
1996 KB |
Output is correct |
7 |
Correct |
1 ms |
1996 KB |
Output is correct |
8 |
Correct |
1 ms |
1996 KB |
Output is correct |
9 |
Correct |
1 ms |
1996 KB |
Output is correct |
10 |
Correct |
1 ms |
1996 KB |
Output is correct |
11 |
Correct |
1 ms |
1996 KB |
Output is correct |
12 |
Correct |
1 ms |
1996 KB |
Output is correct |
13 |
Correct |
1 ms |
1996 KB |
Output is correct |
14 |
Correct |
1 ms |
1996 KB |
Output is correct |
15 |
Correct |
1 ms |
1996 KB |
Output is correct |
16 |
Correct |
1 ms |
1996 KB |
Output is correct |
17 |
Correct |
1 ms |
1996 KB |
Output is correct |
18 |
Correct |
1 ms |
1996 KB |
Output is correct |
19 |
Correct |
1 ms |
1940 KB |
Output is correct |
20 |
Correct |
1 ms |
1996 KB |
Output is correct |
21 |
Correct |
1 ms |
1996 KB |
Output is correct |
22 |
Correct |
1 ms |
1996 KB |
Output is correct |
23 |
Correct |
2 ms |
1996 KB |
Output is correct |
24 |
Correct |
1 ms |
1996 KB |
Output is correct |
25 |
Correct |
1 ms |
1996 KB |
Output is correct |
26 |
Correct |
1 ms |
1996 KB |
Output is correct |
27 |
Correct |
1 ms |
1996 KB |
Output is correct |
28 |
Correct |
1 ms |
1996 KB |
Output is correct |
29 |
Correct |
1 ms |
1996 KB |
Output is correct |
30 |
Correct |
1 ms |
1996 KB |
Output is correct |
31 |
Correct |
1 ms |
1868 KB |
Output is correct |
32 |
Correct |
1 ms |
1996 KB |
Output is correct |
33 |
Correct |
1 ms |
1996 KB |
Output is correct |
34 |
Correct |
1 ms |
1996 KB |
Output is correct |
35 |
Correct |
1 ms |
1868 KB |
Output is correct |
36 |
Correct |
1 ms |
1996 KB |
Output is correct |
37 |
Correct |
1 ms |
1996 KB |
Output is correct |
38 |
Correct |
1 ms |
1996 KB |
Output is correct |
39 |
Correct |
1 ms |
1996 KB |
Output is correct |
40 |
Correct |
1 ms |
1996 KB |
Output is correct |
41 |
Correct |
1 ms |
1996 KB |
Output is correct |
42 |
Correct |
1 ms |
1868 KB |
Output is correct |
43 |
Correct |
2 ms |
1996 KB |
Output is correct |
44 |
Correct |
1 ms |
1996 KB |
Output is correct |
45 |
Correct |
1 ms |
1996 KB |
Output is correct |
46 |
Correct |
1 ms |
1996 KB |
Output is correct |
47 |
Correct |
1 ms |
1996 KB |
Output is correct |
48 |
Correct |
1 ms |
1996 KB |
Output is correct |
49 |
Correct |
1 ms |
1996 KB |
Output is correct |
50 |
Correct |
2 ms |
1996 KB |
Output is correct |
51 |
Correct |
1 ms |
1996 KB |
Output is correct |
52 |
Correct |
1 ms |
1996 KB |
Output is correct |
53 |
Correct |
1 ms |
1996 KB |
Output is correct |
54 |
Correct |
1 ms |
1996 KB |
Output is correct |
55 |
Correct |
1 ms |
1932 KB |
Output is correct |
56 |
Correct |
1 ms |
1996 KB |
Output is correct |
57 |
Correct |
1 ms |
1972 KB |
Output is correct |
58 |
Correct |
1 ms |
1996 KB |
Output is correct |
59 |
Correct |
0 ms |
332 KB |
Output is correct |
60 |
Correct |
88 ms |
43224 KB |
Output is correct |
61 |
Correct |
41 ms |
27308 KB |
Output is correct |
62 |
Correct |
158 ms |
44064 KB |
Output is correct |
63 |
Correct |
991 ms |
139812 KB |
Output is correct |
64 |
Correct |
2210 ms |
503640 KB |
Output is correct |
65 |
Correct |
440 ms |
106632 KB |
Output is correct |
66 |
Correct |
773 ms |
87688 KB |
Output is correct |
67 |
Correct |
2439 ms |
449540 KB |
Output is correct |
68 |
Correct |
203 ms |
61500 KB |
Output is correct |
69 |
Correct |
131 ms |
33836 KB |
Output is correct |
70 |
Correct |
2588 ms |
144020 KB |
Output is correct |
71 |
Correct |
339 ms |
52820 KB |
Output is correct |
72 |
Correct |
212 ms |
67684 KB |
Output is correct |
73 |
Correct |
592 ms |
82156 KB |
Output is correct |
74 |
Correct |
1562 ms |
232132 KB |
Output is correct |
75 |
Correct |
1501 ms |
122212 KB |
Output is correct |
76 |
Correct |
1076 ms |
169252 KB |
Output is correct |
77 |
Correct |
495 ms |
45540 KB |
Output is correct |
78 |
Correct |
299 ms |
50712 KB |
Output is correct |
79 |
Correct |
381 ms |
43236 KB |
Output is correct |
80 |
Correct |
1118 ms |
156460 KB |
Output is correct |
81 |
Correct |
1079 ms |
182476 KB |
Output is correct |
82 |
Correct |
1541 ms |
140916 KB |
Output is correct |
83 |
Correct |
1186 ms |
156356 KB |
Output is correct |
84 |
Correct |
573 ms |
131436 KB |
Output is correct |
85 |
Correct |
1717 ms |
310084 KB |
Output is correct |
86 |
Correct |
890 ms |
109384 KB |
Output is correct |
87 |
Correct |
1317 ms |
157396 KB |
Output is correct |
88 |
Correct |
1312 ms |
154144 KB |
Output is correct |
89 |
Correct |
468 ms |
131968 KB |
Output is correct |
90 |
Correct |
172 ms |
47684 KB |
Output is correct |
91 |
Correct |
2174 ms |
121740 KB |
Output is correct |
92 |
Correct |
1945 ms |
207512 KB |
Output is correct |
93 |
Correct |
772 ms |
217936 KB |
Output is correct |
94 |
Correct |
2371 ms |
86900 KB |
Output is correct |
95 |
Correct |
2097 ms |
104836 KB |
Output is correct |
96 |
Correct |
256 ms |
55364 KB |
Output is correct |
97 |
Correct |
552 ms |
85980 KB |
Output is correct |
98 |
Correct |
550 ms |
108404 KB |
Output is correct |
99 |
Correct |
966 ms |
96164 KB |
Output is correct |
100 |
Correct |
1919 ms |
155068 KB |
Output is correct |
101 |
Correct |
1055 ms |
111272 KB |
Output is correct |
102 |
Correct |
744 ms |
206516 KB |
Output is correct |
103 |
Correct |
699 ms |
168624 KB |
Output is correct |
104 |
Correct |
1382 ms |
187568 KB |
Output is correct |
105 |
Correct |
1408 ms |
243740 KB |
Output is correct |
106 |
Correct |
1104 ms |
88800 KB |
Output is correct |
107 |
Correct |
1253 ms |
244640 KB |
Output is correct |
108 |
Correct |
900 ms |
140144 KB |
Output is correct |
109 |
Correct |
229 ms |
147436 KB |
Output is correct |
110 |
Correct |
313 ms |
177592 KB |
Output is correct |
111 |
Correct |
1928 ms |
229164 KB |
Output is correct |
112 |
Correct |
2407 ms |
265096 KB |
Output is correct |
113 |
Correct |
2021 ms |
157040 KB |
Output is correct |
114 |
Correct |
2236 ms |
230352 KB |
Output is correct |
115 |
Correct |
1956 ms |
125260 KB |
Output is correct |
116 |
Correct |
2335 ms |
189640 KB |
Output is correct |
117 |
Correct |
2088 ms |
168104 KB |
Output is correct |
118 |
Correct |
2287 ms |
278188 KB |
Output is correct |
119 |
Correct |
2225 ms |
153024 KB |
Output is correct |
120 |
Correct |
2063 ms |
208376 KB |
Output is correct |
121 |
Correct |
1245 ms |
163320 KB |
Output is correct |
122 |
Correct |
1208 ms |
163056 KB |
Output is correct |
123 |
Correct |
2183 ms |
108900 KB |
Output is correct |
124 |
Correct |
1698 ms |
188504 KB |
Output is correct |
125 |
Correct |
1795 ms |
174520 KB |
Output is correct |
126 |
Correct |
2059 ms |
89236 KB |
Output is correct |
127 |
Correct |
2052 ms |
210452 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
1996 KB |
Output is correct |
3 |
Correct |
2 ms |
1996 KB |
Output is correct |
4 |
Correct |
1 ms |
1996 KB |
Output is correct |
5 |
Correct |
1 ms |
1996 KB |
Output is correct |
6 |
Correct |
1 ms |
1996 KB |
Output is correct |
7 |
Correct |
1 ms |
1996 KB |
Output is correct |
8 |
Correct |
1 ms |
1996 KB |
Output is correct |
9 |
Correct |
1 ms |
1996 KB |
Output is correct |
10 |
Correct |
1 ms |
1996 KB |
Output is correct |
11 |
Correct |
1 ms |
1996 KB |
Output is correct |
12 |
Correct |
1 ms |
1996 KB |
Output is correct |
13 |
Correct |
1 ms |
1996 KB |
Output is correct |
14 |
Correct |
1 ms |
1996 KB |
Output is correct |
15 |
Correct |
1 ms |
1996 KB |
Output is correct |
16 |
Correct |
1 ms |
1996 KB |
Output is correct |
17 |
Correct |
1 ms |
1996 KB |
Output is correct |
18 |
Correct |
1 ms |
1996 KB |
Output is correct |
19 |
Correct |
1 ms |
1940 KB |
Output is correct |
20 |
Correct |
1 ms |
1996 KB |
Output is correct |
21 |
Correct |
1 ms |
1996 KB |
Output is correct |
22 |
Correct |
1 ms |
1996 KB |
Output is correct |
23 |
Correct |
2 ms |
1996 KB |
Output is correct |
24 |
Correct |
1 ms |
1996 KB |
Output is correct |
25 |
Correct |
1 ms |
1996 KB |
Output is correct |
26 |
Correct |
1 ms |
1996 KB |
Output is correct |
27 |
Correct |
1 ms |
1996 KB |
Output is correct |
28 |
Correct |
1 ms |
1996 KB |
Output is correct |
29 |
Correct |
1 ms |
1996 KB |
Output is correct |
30 |
Correct |
1 ms |
1996 KB |
Output is correct |
31 |
Correct |
1 ms |
1868 KB |
Output is correct |
32 |
Correct |
1 ms |
1996 KB |
Output is correct |
33 |
Correct |
1 ms |
1996 KB |
Output is correct |
34 |
Correct |
1 ms |
1996 KB |
Output is correct |
35 |
Correct |
1 ms |
1868 KB |
Output is correct |
36 |
Correct |
1 ms |
1996 KB |
Output is correct |
37 |
Correct |
1 ms |
1996 KB |
Output is correct |
38 |
Correct |
1 ms |
1996 KB |
Output is correct |
39 |
Correct |
1 ms |
1996 KB |
Output is correct |
40 |
Correct |
1 ms |
1996 KB |
Output is correct |
41 |
Correct |
1 ms |
1996 KB |
Output is correct |
42 |
Correct |
1 ms |
1868 KB |
Output is correct |
43 |
Correct |
2 ms |
1996 KB |
Output is correct |
44 |
Correct |
1 ms |
1996 KB |
Output is correct |
45 |
Correct |
1 ms |
1996 KB |
Output is correct |
46 |
Correct |
1 ms |
1996 KB |
Output is correct |
47 |
Correct |
1 ms |
1996 KB |
Output is correct |
48 |
Correct |
1 ms |
1996 KB |
Output is correct |
49 |
Correct |
1 ms |
1996 KB |
Output is correct |
50 |
Correct |
2 ms |
1996 KB |
Output is correct |
51 |
Correct |
1 ms |
1996 KB |
Output is correct |
52 |
Correct |
1 ms |
1996 KB |
Output is correct |
53 |
Correct |
1 ms |
1996 KB |
Output is correct |
54 |
Correct |
1 ms |
1996 KB |
Output is correct |
55 |
Correct |
1 ms |
1932 KB |
Output is correct |
56 |
Correct |
1 ms |
1996 KB |
Output is correct |
57 |
Correct |
1 ms |
1972 KB |
Output is correct |
58 |
Correct |
1 ms |
1996 KB |
Output is correct |
59 |
Correct |
0 ms |
332 KB |
Output is correct |
60 |
Correct |
88 ms |
43224 KB |
Output is correct |
61 |
Correct |
41 ms |
27308 KB |
Output is correct |
62 |
Correct |
158 ms |
44064 KB |
Output is correct |
63 |
Correct |
991 ms |
139812 KB |
Output is correct |
64 |
Correct |
2210 ms |
503640 KB |
Output is correct |
65 |
Correct |
440 ms |
106632 KB |
Output is correct |
66 |
Correct |
773 ms |
87688 KB |
Output is correct |
67 |
Correct |
2439 ms |
449540 KB |
Output is correct |
68 |
Correct |
203 ms |
61500 KB |
Output is correct |
69 |
Correct |
131 ms |
33836 KB |
Output is correct |
70 |
Correct |
2588 ms |
144020 KB |
Output is correct |
71 |
Correct |
339 ms |
52820 KB |
Output is correct |
72 |
Correct |
212 ms |
67684 KB |
Output is correct |
73 |
Correct |
592 ms |
82156 KB |
Output is correct |
74 |
Correct |
1562 ms |
232132 KB |
Output is correct |
75 |
Correct |
1501 ms |
122212 KB |
Output is correct |
76 |
Correct |
1076 ms |
169252 KB |
Output is correct |
77 |
Correct |
495 ms |
45540 KB |
Output is correct |
78 |
Correct |
299 ms |
50712 KB |
Output is correct |
79 |
Correct |
381 ms |
43236 KB |
Output is correct |
80 |
Correct |
1118 ms |
156460 KB |
Output is correct |
81 |
Correct |
1079 ms |
182476 KB |
Output is correct |
82 |
Correct |
1541 ms |
140916 KB |
Output is correct |
83 |
Correct |
1186 ms |
156356 KB |
Output is correct |
84 |
Correct |
573 ms |
131436 KB |
Output is correct |
85 |
Correct |
1717 ms |
310084 KB |
Output is correct |
86 |
Correct |
890 ms |
109384 KB |
Output is correct |
87 |
Correct |
1317 ms |
157396 KB |
Output is correct |
88 |
Correct |
1312 ms |
154144 KB |
Output is correct |
89 |
Correct |
468 ms |
131968 KB |
Output is correct |
90 |
Correct |
172 ms |
47684 KB |
Output is correct |
91 |
Correct |
2174 ms |
121740 KB |
Output is correct |
92 |
Correct |
1945 ms |
207512 KB |
Output is correct |
93 |
Correct |
772 ms |
217936 KB |
Output is correct |
94 |
Correct |
2371 ms |
86900 KB |
Output is correct |
95 |
Correct |
2097 ms |
104836 KB |
Output is correct |
96 |
Correct |
256 ms |
55364 KB |
Output is correct |
97 |
Correct |
552 ms |
85980 KB |
Output is correct |
98 |
Correct |
550 ms |
108404 KB |
Output is correct |
99 |
Correct |
966 ms |
96164 KB |
Output is correct |
100 |
Correct |
1919 ms |
155068 KB |
Output is correct |
101 |
Correct |
1055 ms |
111272 KB |
Output is correct |
102 |
Correct |
744 ms |
206516 KB |
Output is correct |
103 |
Correct |
699 ms |
168624 KB |
Output is correct |
104 |
Correct |
1382 ms |
187568 KB |
Output is correct |
105 |
Correct |
1408 ms |
243740 KB |
Output is correct |
106 |
Correct |
1104 ms |
88800 KB |
Output is correct |
107 |
Correct |
1253 ms |
244640 KB |
Output is correct |
108 |
Correct |
900 ms |
140144 KB |
Output is correct |
109 |
Correct |
229 ms |
147436 KB |
Output is correct |
110 |
Correct |
313 ms |
177592 KB |
Output is correct |
111 |
Correct |
1928 ms |
229164 KB |
Output is correct |
112 |
Correct |
2407 ms |
265096 KB |
Output is correct |
113 |
Correct |
2021 ms |
157040 KB |
Output is correct |
114 |
Correct |
2236 ms |
230352 KB |
Output is correct |
115 |
Correct |
1956 ms |
125260 KB |
Output is correct |
116 |
Correct |
2335 ms |
189640 KB |
Output is correct |
117 |
Correct |
2088 ms |
168104 KB |
Output is correct |
118 |
Correct |
2287 ms |
278188 KB |
Output is correct |
119 |
Correct |
2225 ms |
153024 KB |
Output is correct |
120 |
Correct |
2063 ms |
208376 KB |
Output is correct |
121 |
Correct |
1245 ms |
163320 KB |
Output is correct |
122 |
Correct |
1208 ms |
163056 KB |
Output is correct |
123 |
Correct |
2183 ms |
108900 KB |
Output is correct |
124 |
Correct |
1698 ms |
188504 KB |
Output is correct |
125 |
Correct |
1795 ms |
174520 KB |
Output is correct |
126 |
Correct |
2059 ms |
89236 KB |
Output is correct |
127 |
Correct |
2052 ms |
210452 KB |
Output is correct |
128 |
Correct |
0 ms |
296 KB |
Output is correct |
129 |
Runtime error |
17 ms |
716 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 |
1 ms |
1996 KB |
Output is correct |
3 |
Correct |
2 ms |
1996 KB |
Output is correct |
4 |
Correct |
1 ms |
1996 KB |
Output is correct |
5 |
Correct |
1 ms |
1996 KB |
Output is correct |
6 |
Correct |
1 ms |
1996 KB |
Output is correct |
7 |
Correct |
1 ms |
1996 KB |
Output is correct |
8 |
Correct |
1 ms |
1996 KB |
Output is correct |
9 |
Correct |
1 ms |
1996 KB |
Output is correct |
10 |
Correct |
1 ms |
1996 KB |
Output is correct |
11 |
Correct |
1 ms |
1996 KB |
Output is correct |
12 |
Correct |
1 ms |
1996 KB |
Output is correct |
13 |
Correct |
1 ms |
1996 KB |
Output is correct |
14 |
Correct |
1 ms |
1996 KB |
Output is correct |
15 |
Correct |
1 ms |
1996 KB |
Output is correct |
16 |
Correct |
1 ms |
1996 KB |
Output is correct |
17 |
Correct |
1 ms |
1996 KB |
Output is correct |
18 |
Correct |
1 ms |
1996 KB |
Output is correct |
19 |
Correct |
1 ms |
1940 KB |
Output is correct |
20 |
Correct |
1 ms |
1996 KB |
Output is correct |
21 |
Correct |
1 ms |
1996 KB |
Output is correct |
22 |
Correct |
1 ms |
1996 KB |
Output is correct |
23 |
Correct |
2 ms |
1996 KB |
Output is correct |
24 |
Correct |
1 ms |
1996 KB |
Output is correct |
25 |
Correct |
1 ms |
1996 KB |
Output is correct |
26 |
Correct |
1 ms |
1996 KB |
Output is correct |
27 |
Correct |
1 ms |
1996 KB |
Output is correct |
28 |
Correct |
1 ms |
1996 KB |
Output is correct |
29 |
Correct |
1 ms |
1996 KB |
Output is correct |
30 |
Correct |
1 ms |
1996 KB |
Output is correct |
31 |
Correct |
1 ms |
1868 KB |
Output is correct |
32 |
Correct |
1 ms |
1996 KB |
Output is correct |
33 |
Correct |
1 ms |
1996 KB |
Output is correct |
34 |
Correct |
1 ms |
1996 KB |
Output is correct |
35 |
Correct |
1 ms |
1868 KB |
Output is correct |
36 |
Correct |
1 ms |
1996 KB |
Output is correct |
37 |
Correct |
1 ms |
1996 KB |
Output is correct |
38 |
Correct |
1 ms |
1996 KB |
Output is correct |
39 |
Correct |
1 ms |
1996 KB |
Output is correct |
40 |
Correct |
1 ms |
1996 KB |
Output is correct |
41 |
Correct |
1 ms |
1996 KB |
Output is correct |
42 |
Correct |
1 ms |
1868 KB |
Output is correct |
43 |
Correct |
2 ms |
1996 KB |
Output is correct |
44 |
Correct |
1 ms |
1996 KB |
Output is correct |
45 |
Correct |
1 ms |
1996 KB |
Output is correct |
46 |
Correct |
1 ms |
1996 KB |
Output is correct |
47 |
Correct |
1 ms |
1996 KB |
Output is correct |
48 |
Correct |
1 ms |
1996 KB |
Output is correct |
49 |
Correct |
1 ms |
1996 KB |
Output is correct |
50 |
Correct |
2 ms |
1996 KB |
Output is correct |
51 |
Correct |
1 ms |
1996 KB |
Output is correct |
52 |
Correct |
1 ms |
1996 KB |
Output is correct |
53 |
Correct |
1 ms |
1996 KB |
Output is correct |
54 |
Correct |
1 ms |
1996 KB |
Output is correct |
55 |
Correct |
1 ms |
1932 KB |
Output is correct |
56 |
Correct |
1 ms |
1996 KB |
Output is correct |
57 |
Correct |
1 ms |
1972 KB |
Output is correct |
58 |
Correct |
1 ms |
1996 KB |
Output is correct |
59 |
Correct |
0 ms |
332 KB |
Output is correct |
60 |
Correct |
88 ms |
43224 KB |
Output is correct |
61 |
Correct |
41 ms |
27308 KB |
Output is correct |
62 |
Correct |
158 ms |
44064 KB |
Output is correct |
63 |
Correct |
991 ms |
139812 KB |
Output is correct |
64 |
Correct |
2210 ms |
503640 KB |
Output is correct |
65 |
Correct |
440 ms |
106632 KB |
Output is correct |
66 |
Correct |
773 ms |
87688 KB |
Output is correct |
67 |
Correct |
2439 ms |
449540 KB |
Output is correct |
68 |
Correct |
203 ms |
61500 KB |
Output is correct |
69 |
Correct |
131 ms |
33836 KB |
Output is correct |
70 |
Correct |
2588 ms |
144020 KB |
Output is correct |
71 |
Correct |
339 ms |
52820 KB |
Output is correct |
72 |
Correct |
212 ms |
67684 KB |
Output is correct |
73 |
Correct |
592 ms |
82156 KB |
Output is correct |
74 |
Correct |
1562 ms |
232132 KB |
Output is correct |
75 |
Correct |
1501 ms |
122212 KB |
Output is correct |
76 |
Correct |
1076 ms |
169252 KB |
Output is correct |
77 |
Correct |
495 ms |
45540 KB |
Output is correct |
78 |
Correct |
299 ms |
50712 KB |
Output is correct |
79 |
Correct |
381 ms |
43236 KB |
Output is correct |
80 |
Correct |
1118 ms |
156460 KB |
Output is correct |
81 |
Correct |
1079 ms |
182476 KB |
Output is correct |
82 |
Correct |
1541 ms |
140916 KB |
Output is correct |
83 |
Correct |
1186 ms |
156356 KB |
Output is correct |
84 |
Correct |
573 ms |
131436 KB |
Output is correct |
85 |
Correct |
1717 ms |
310084 KB |
Output is correct |
86 |
Correct |
890 ms |
109384 KB |
Output is correct |
87 |
Correct |
1317 ms |
157396 KB |
Output is correct |
88 |
Correct |
1312 ms |
154144 KB |
Output is correct |
89 |
Correct |
468 ms |
131968 KB |
Output is correct |
90 |
Correct |
172 ms |
47684 KB |
Output is correct |
91 |
Correct |
2174 ms |
121740 KB |
Output is correct |
92 |
Correct |
1945 ms |
207512 KB |
Output is correct |
93 |
Correct |
772 ms |
217936 KB |
Output is correct |
94 |
Correct |
2371 ms |
86900 KB |
Output is correct |
95 |
Correct |
2097 ms |
104836 KB |
Output is correct |
96 |
Correct |
256 ms |
55364 KB |
Output is correct |
97 |
Correct |
552 ms |
85980 KB |
Output is correct |
98 |
Correct |
550 ms |
108404 KB |
Output is correct |
99 |
Correct |
966 ms |
96164 KB |
Output is correct |
100 |
Correct |
1919 ms |
155068 KB |
Output is correct |
101 |
Correct |
1055 ms |
111272 KB |
Output is correct |
102 |
Correct |
744 ms |
206516 KB |
Output is correct |
103 |
Correct |
699 ms |
168624 KB |
Output is correct |
104 |
Correct |
1382 ms |
187568 KB |
Output is correct |
105 |
Correct |
1408 ms |
243740 KB |
Output is correct |
106 |
Correct |
1104 ms |
88800 KB |
Output is correct |
107 |
Correct |
1253 ms |
244640 KB |
Output is correct |
108 |
Correct |
900 ms |
140144 KB |
Output is correct |
109 |
Correct |
229 ms |
147436 KB |
Output is correct |
110 |
Correct |
313 ms |
177592 KB |
Output is correct |
111 |
Correct |
1928 ms |
229164 KB |
Output is correct |
112 |
Correct |
2407 ms |
265096 KB |
Output is correct |
113 |
Correct |
2021 ms |
157040 KB |
Output is correct |
114 |
Correct |
2236 ms |
230352 KB |
Output is correct |
115 |
Correct |
1956 ms |
125260 KB |
Output is correct |
116 |
Correct |
2335 ms |
189640 KB |
Output is correct |
117 |
Correct |
2088 ms |
168104 KB |
Output is correct |
118 |
Correct |
2287 ms |
278188 KB |
Output is correct |
119 |
Correct |
2225 ms |
153024 KB |
Output is correct |
120 |
Correct |
2063 ms |
208376 KB |
Output is correct |
121 |
Correct |
1245 ms |
163320 KB |
Output is correct |
122 |
Correct |
1208 ms |
163056 KB |
Output is correct |
123 |
Correct |
2183 ms |
108900 KB |
Output is correct |
124 |
Correct |
1698 ms |
188504 KB |
Output is correct |
125 |
Correct |
1795 ms |
174520 KB |
Output is correct |
126 |
Correct |
2059 ms |
89236 KB |
Output is correct |
127 |
Correct |
2052 ms |
210452 KB |
Output is correct |
128 |
Correct |
0 ms |
296 KB |
Output is correct |
129 |
Runtime error |
17 ms |
716 KB |
Execution killed with signal 11 |
130 |
Halted |
0 ms |
0 KB |
- |