#include <bits/stdc++.h>
#include "closing.h"
#define ar array
#define ll long long
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
using namespace std;
template<typename T> bool ckmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }
template<typename T> bool ckmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }
const ll INF = 1e18;
int max_score(int n, int X, int Y, long long K,
std::vector<int> U, std::vector<int> V, std::vector<int> W) {
vector<vector<ar<int, 2>>> adj(n+1);
for (int i = 0; i < n-1; i++) {
adj[U[i]].push_back({V[i], W[i]});
adj[V[i]].push_back({U[i], W[i]});
}
vector<vector<ll>> d(2, vector<ll>(n, INF));
vector<int> p(n, -1);
auto dfs = [&](auto&& s, int v, vector<ll>& dist) -> void {
for (auto [u, w] : adj[v]) if (u != p[v]) {
p[u] = v, dist[u] = dist[v] + w;
s(s, u, dist);
}
};
d[0][X] = 0, d[1][Y] = 0;
dfs(dfs, X, d[0]);
fill(all(p), -1);
dfs(dfs, Y, d[1]);
vector<vector<ar<ll, 4>>> dp(n, vector<ar<ll, 4>>(2*n+1, {INF, INF, INF, INF}));
vector<int> tin(n), tout(n), sub(n);
int timer = 0;
auto dfs3 = [&](auto&& s, int v, int px) -> void {
tin[v] = timer++, sub[v] = 1;
for (auto [u, w] : adj[v]) if (u != px) {
s(s, u, v);
sub[v] += sub[u];
}
tout[v] = timer-1;
};
dfs3(dfs3, X, -1);
auto anc = [&](int x, int y) {
return tin[x] <= tin[y] && tout[y] <= tout[x];
};
auto dfs2 = [&](auto&& s, int v, int px) -> void {
dp[v][0][0] = 0;
dp[v][1][1] = d[0][v];
dp[v][1][2] = d[1][v];
dp[v][2][3] = max(d[0][v], d[1][v]);
int tot = 2;
sort(all(adj[v]), [&](auto x, auto y) { return anc(x[0], Y) != anc(y[0], Y) ? anc(x[0], Y) : x[0] < y[0]; });
for (auto [u, w] : adj[v]) if (u != px) {
s(s, u, v);
assert(tot <= 2*n);
for (int i = tot; i >= 0; i--) {
for (int j = 2*sub[u]; j >= 0; j--) {
assert(i+j<=2*n);
ckmin(dp[v][i+j][0], dp[v][i][0] + dp[u][j][0]);
if (anc(u, Y)) ckmin(dp[v][i+j][0], dp[v][i][0] + dp[u][j][2]);
ckmin(dp[v][i+j][1], dp[v][i][1] + dp[u][j][0]);
ckmin(dp[v][i+j][1], dp[v][i][1] + dp[u][j][1]);
if (anc(u, Y)) {
ckmin(dp[v][i+j][1], dp[v][i][1] + dp[u][j][2]);
ckmin(dp[v][i+j][1], dp[v][i][1] + dp[u][j][3]);
}
if (anc(u, Y)) {
if (i == 1) dp[v][i+j][2] = dp[v][i][2] + dp[u][j][2];
}
else {
ckmin(dp[v][i+j][2], dp[v][i][2] + dp[u][j][0]);
ckmin(dp[v][i+j][2], dp[v][i][2] + dp[u][j][2]);
}
if (anc(u, Y)) {
if (i == 2) dp[v][i+j][3] = dp[v][i][3] + min(dp[u][j][2], dp[u][j][3]);
}
else {
ckmin(dp[v][i+j][3], dp[v][i][3] + dp[u][j][0]);
ckmin(dp[v][i+j][3], dp[v][i][3] + dp[u][j][1]);
ckmin(dp[v][i+j][3], dp[v][i][3] + dp[u][j][2]);
ckmin(dp[v][i+j][3], dp[v][i][3] + dp[u][j][3]);
}
}
}
tot += 2*sub[u];
}
};
dfs2(dfs2, X, -1);
int ans = 0;
for (int j = 1; j <= 2*n; j++) for (int k = 0; k < 4; k++) if (dp[X][j][k] <= K) ckmax(ans, j);
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
933 ms |
2097152 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
600 KB |
Output is correct |
11 |
Correct |
0 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
600 KB |
Output is correct |
11 |
Correct |
0 ms |
604 KB |
Output is correct |
12 |
Correct |
1 ms |
944 KB |
Output is correct |
13 |
Correct |
1 ms |
860 KB |
Output is correct |
14 |
Correct |
1 ms |
860 KB |
Output is correct |
15 |
Correct |
1 ms |
860 KB |
Output is correct |
16 |
Correct |
1 ms |
860 KB |
Output is correct |
17 |
Correct |
1 ms |
860 KB |
Output is correct |
18 |
Correct |
1 ms |
344 KB |
Output is correct |
19 |
Correct |
19 ms |
16220 KB |
Output is correct |
20 |
Correct |
9 ms |
13660 KB |
Output is correct |
21 |
Correct |
10 ms |
14844 KB |
Output is correct |
22 |
Correct |
10 ms |
15960 KB |
Output is correct |
23 |
Correct |
10 ms |
16220 KB |
Output is correct |
24 |
Correct |
11 ms |
16080 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
600 KB |
Output is correct |
11 |
Correct |
0 ms |
604 KB |
Output is correct |
12 |
Correct |
1 ms |
944 KB |
Output is correct |
13 |
Correct |
1 ms |
860 KB |
Output is correct |
14 |
Correct |
1 ms |
860 KB |
Output is correct |
15 |
Correct |
1 ms |
860 KB |
Output is correct |
16 |
Correct |
1 ms |
860 KB |
Output is correct |
17 |
Correct |
1 ms |
860 KB |
Output is correct |
18 |
Correct |
1 ms |
344 KB |
Output is correct |
19 |
Correct |
19 ms |
16220 KB |
Output is correct |
20 |
Correct |
9 ms |
13660 KB |
Output is correct |
21 |
Correct |
10 ms |
14844 KB |
Output is correct |
22 |
Correct |
10 ms |
15960 KB |
Output is correct |
23 |
Correct |
10 ms |
16220 KB |
Output is correct |
24 |
Correct |
11 ms |
16080 KB |
Output is correct |
25 |
Correct |
5 ms |
680 KB |
Output is correct |
26 |
Correct |
405 ms |
566272 KB |
Output is correct |
27 |
Correct |
337 ms |
492768 KB |
Output is correct |
28 |
Correct |
340 ms |
496600 KB |
Output is correct |
29 |
Correct |
355 ms |
539536 KB |
Output is correct |
30 |
Correct |
321 ms |
490428 KB |
Output is correct |
31 |
Correct |
364 ms |
566144 KB |
Output is correct |
32 |
Correct |
352 ms |
566164 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
344 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
1 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
344 KB |
Output is correct |
23 |
Correct |
0 ms |
344 KB |
Output is correct |
24 |
Correct |
0 ms |
600 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
600 KB |
Output is correct |
12 |
Correct |
0 ms |
604 KB |
Output is correct |
13 |
Correct |
1 ms |
944 KB |
Output is correct |
14 |
Correct |
1 ms |
860 KB |
Output is correct |
15 |
Correct |
1 ms |
860 KB |
Output is correct |
16 |
Correct |
1 ms |
860 KB |
Output is correct |
17 |
Correct |
1 ms |
860 KB |
Output is correct |
18 |
Correct |
1 ms |
860 KB |
Output is correct |
19 |
Correct |
0 ms |
344 KB |
Output is correct |
20 |
Correct |
1 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
1 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
1 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
344 KB |
Output is correct |
35 |
Correct |
0 ms |
344 KB |
Output is correct |
36 |
Correct |
0 ms |
600 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
1 ms |
348 KB |
Output is correct |
39 |
Correct |
1 ms |
1116 KB |
Output is correct |
40 |
Correct |
1 ms |
860 KB |
Output is correct |
41 |
Correct |
1 ms |
860 KB |
Output is correct |
42 |
Correct |
1 ms |
860 KB |
Output is correct |
43 |
Correct |
1 ms |
860 KB |
Output is correct |
44 |
Correct |
1 ms |
860 KB |
Output is correct |
45 |
Correct |
1 ms |
860 KB |
Output is correct |
46 |
Correct |
1 ms |
860 KB |
Output is correct |
47 |
Correct |
1 ms |
856 KB |
Output is correct |
48 |
Correct |
1 ms |
860 KB |
Output is correct |
49 |
Correct |
0 ms |
604 KB |
Output is correct |
50 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
600 KB |
Output is correct |
12 |
Correct |
0 ms |
604 KB |
Output is correct |
13 |
Correct |
1 ms |
944 KB |
Output is correct |
14 |
Correct |
1 ms |
860 KB |
Output is correct |
15 |
Correct |
1 ms |
860 KB |
Output is correct |
16 |
Correct |
1 ms |
860 KB |
Output is correct |
17 |
Correct |
1 ms |
860 KB |
Output is correct |
18 |
Correct |
1 ms |
860 KB |
Output is correct |
19 |
Correct |
1 ms |
344 KB |
Output is correct |
20 |
Correct |
19 ms |
16220 KB |
Output is correct |
21 |
Correct |
9 ms |
13660 KB |
Output is correct |
22 |
Correct |
10 ms |
14844 KB |
Output is correct |
23 |
Correct |
10 ms |
15960 KB |
Output is correct |
24 |
Correct |
10 ms |
16220 KB |
Output is correct |
25 |
Correct |
11 ms |
16080 KB |
Output is correct |
26 |
Correct |
0 ms |
344 KB |
Output is correct |
27 |
Correct |
1 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
1 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
1 ms |
348 KB |
Output is correct |
41 |
Correct |
0 ms |
344 KB |
Output is correct |
42 |
Correct |
0 ms |
344 KB |
Output is correct |
43 |
Correct |
0 ms |
600 KB |
Output is correct |
44 |
Correct |
0 ms |
348 KB |
Output is correct |
45 |
Correct |
1 ms |
348 KB |
Output is correct |
46 |
Correct |
1 ms |
1116 KB |
Output is correct |
47 |
Correct |
1 ms |
860 KB |
Output is correct |
48 |
Correct |
1 ms |
860 KB |
Output is correct |
49 |
Correct |
1 ms |
860 KB |
Output is correct |
50 |
Correct |
1 ms |
860 KB |
Output is correct |
51 |
Correct |
1 ms |
860 KB |
Output is correct |
52 |
Correct |
1 ms |
860 KB |
Output is correct |
53 |
Correct |
1 ms |
860 KB |
Output is correct |
54 |
Correct |
1 ms |
856 KB |
Output is correct |
55 |
Correct |
1 ms |
860 KB |
Output is correct |
56 |
Correct |
0 ms |
604 KB |
Output is correct |
57 |
Correct |
1 ms |
348 KB |
Output is correct |
58 |
Correct |
1 ms |
348 KB |
Output is correct |
59 |
Correct |
3 ms |
948 KB |
Output is correct |
60 |
Correct |
2 ms |
1116 KB |
Output is correct |
61 |
Correct |
3 ms |
1884 KB |
Output is correct |
62 |
Correct |
5 ms |
1884 KB |
Output is correct |
63 |
Correct |
10 ms |
15964 KB |
Output is correct |
64 |
Correct |
15 ms |
13916 KB |
Output is correct |
65 |
Correct |
8 ms |
13144 KB |
Output is correct |
66 |
Correct |
9 ms |
14172 KB |
Output is correct |
67 |
Correct |
9 ms |
15964 KB |
Output is correct |
68 |
Correct |
9 ms |
13404 KB |
Output is correct |
69 |
Correct |
10 ms |
15964 KB |
Output is correct |
70 |
Correct |
9 ms |
14940 KB |
Output is correct |
71 |
Correct |
11 ms |
14644 KB |
Output is correct |
72 |
Correct |
16 ms |
15192 KB |
Output is correct |
73 |
Correct |
11 ms |
9816 KB |
Output is correct |
74 |
Correct |
11 ms |
11100 KB |
Output is correct |
75 |
Correct |
3 ms |
1104 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
600 KB |
Output is correct |
12 |
Correct |
0 ms |
604 KB |
Output is correct |
13 |
Correct |
1 ms |
944 KB |
Output is correct |
14 |
Correct |
1 ms |
860 KB |
Output is correct |
15 |
Correct |
1 ms |
860 KB |
Output is correct |
16 |
Correct |
1 ms |
860 KB |
Output is correct |
17 |
Correct |
1 ms |
860 KB |
Output is correct |
18 |
Correct |
1 ms |
860 KB |
Output is correct |
19 |
Correct |
1 ms |
344 KB |
Output is correct |
20 |
Correct |
19 ms |
16220 KB |
Output is correct |
21 |
Correct |
9 ms |
13660 KB |
Output is correct |
22 |
Correct |
10 ms |
14844 KB |
Output is correct |
23 |
Correct |
10 ms |
15960 KB |
Output is correct |
24 |
Correct |
10 ms |
16220 KB |
Output is correct |
25 |
Correct |
11 ms |
16080 KB |
Output is correct |
26 |
Correct |
5 ms |
680 KB |
Output is correct |
27 |
Correct |
405 ms |
566272 KB |
Output is correct |
28 |
Correct |
337 ms |
492768 KB |
Output is correct |
29 |
Correct |
340 ms |
496600 KB |
Output is correct |
30 |
Correct |
355 ms |
539536 KB |
Output is correct |
31 |
Correct |
321 ms |
490428 KB |
Output is correct |
32 |
Correct |
364 ms |
566144 KB |
Output is correct |
33 |
Correct |
352 ms |
566164 KB |
Output is correct |
34 |
Correct |
0 ms |
344 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
1 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
0 ms |
348 KB |
Output is correct |
45 |
Correct |
0 ms |
348 KB |
Output is correct |
46 |
Correct |
0 ms |
348 KB |
Output is correct |
47 |
Correct |
0 ms |
348 KB |
Output is correct |
48 |
Correct |
1 ms |
348 KB |
Output is correct |
49 |
Correct |
0 ms |
344 KB |
Output is correct |
50 |
Correct |
0 ms |
344 KB |
Output is correct |
51 |
Correct |
0 ms |
600 KB |
Output is correct |
52 |
Correct |
0 ms |
348 KB |
Output is correct |
53 |
Correct |
1 ms |
348 KB |
Output is correct |
54 |
Correct |
1 ms |
1116 KB |
Output is correct |
55 |
Correct |
1 ms |
860 KB |
Output is correct |
56 |
Correct |
1 ms |
860 KB |
Output is correct |
57 |
Correct |
1 ms |
860 KB |
Output is correct |
58 |
Correct |
1 ms |
860 KB |
Output is correct |
59 |
Correct |
1 ms |
860 KB |
Output is correct |
60 |
Correct |
1 ms |
860 KB |
Output is correct |
61 |
Correct |
1 ms |
860 KB |
Output is correct |
62 |
Correct |
1 ms |
856 KB |
Output is correct |
63 |
Correct |
1 ms |
860 KB |
Output is correct |
64 |
Correct |
0 ms |
604 KB |
Output is correct |
65 |
Correct |
1 ms |
348 KB |
Output is correct |
66 |
Correct |
1 ms |
348 KB |
Output is correct |
67 |
Correct |
3 ms |
948 KB |
Output is correct |
68 |
Correct |
2 ms |
1116 KB |
Output is correct |
69 |
Correct |
3 ms |
1884 KB |
Output is correct |
70 |
Correct |
5 ms |
1884 KB |
Output is correct |
71 |
Correct |
10 ms |
15964 KB |
Output is correct |
72 |
Correct |
15 ms |
13916 KB |
Output is correct |
73 |
Correct |
8 ms |
13144 KB |
Output is correct |
74 |
Correct |
9 ms |
14172 KB |
Output is correct |
75 |
Correct |
9 ms |
15964 KB |
Output is correct |
76 |
Correct |
9 ms |
13404 KB |
Output is correct |
77 |
Correct |
10 ms |
15964 KB |
Output is correct |
78 |
Correct |
9 ms |
14940 KB |
Output is correct |
79 |
Correct |
11 ms |
14644 KB |
Output is correct |
80 |
Correct |
16 ms |
15192 KB |
Output is correct |
81 |
Correct |
11 ms |
9816 KB |
Output is correct |
82 |
Correct |
11 ms |
11100 KB |
Output is correct |
83 |
Correct |
3 ms |
1104 KB |
Output is correct |
84 |
Correct |
4 ms |
676 KB |
Output is correct |
85 |
Correct |
45 ms |
5232 KB |
Output is correct |
86 |
Correct |
10 ms |
1160 KB |
Output is correct |
87 |
Correct |
15 ms |
1920 KB |
Output is correct |
88 |
Correct |
15 ms |
2024 KB |
Output is correct |
89 |
Correct |
375 ms |
566016 KB |
Output is correct |
90 |
Correct |
346 ms |
468800 KB |
Output is correct |
91 |
Correct |
379 ms |
563348 KB |
Output is correct |
92 |
Correct |
322 ms |
491648 KB |
Output is correct |
93 |
Correct |
299 ms |
496948 KB |
Output is correct |
94 |
Correct |
344 ms |
515744 KB |
Output is correct |
95 |
Correct |
395 ms |
540340 KB |
Output is correct |
96 |
Correct |
314 ms |
472392 KB |
Output is correct |
97 |
Correct |
357 ms |
538964 KB |
Output is correct |
98 |
Correct |
341 ms |
520052 KB |
Output is correct |
99 |
Correct |
346 ms |
566096 KB |
Output is correct |
100 |
Correct |
234 ms |
276304 KB |
Output is correct |
101 |
Correct |
38 ms |
16168 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
600 KB |
Output is correct |
12 |
Correct |
0 ms |
604 KB |
Output is correct |
13 |
Correct |
1 ms |
944 KB |
Output is correct |
14 |
Correct |
1 ms |
860 KB |
Output is correct |
15 |
Correct |
1 ms |
860 KB |
Output is correct |
16 |
Correct |
1 ms |
860 KB |
Output is correct |
17 |
Correct |
1 ms |
860 KB |
Output is correct |
18 |
Correct |
1 ms |
860 KB |
Output is correct |
19 |
Correct |
1 ms |
344 KB |
Output is correct |
20 |
Correct |
19 ms |
16220 KB |
Output is correct |
21 |
Correct |
9 ms |
13660 KB |
Output is correct |
22 |
Correct |
10 ms |
14844 KB |
Output is correct |
23 |
Correct |
10 ms |
15960 KB |
Output is correct |
24 |
Correct |
10 ms |
16220 KB |
Output is correct |
25 |
Correct |
11 ms |
16080 KB |
Output is correct |
26 |
Correct |
5 ms |
680 KB |
Output is correct |
27 |
Correct |
405 ms |
566272 KB |
Output is correct |
28 |
Correct |
337 ms |
492768 KB |
Output is correct |
29 |
Correct |
340 ms |
496600 KB |
Output is correct |
30 |
Correct |
355 ms |
539536 KB |
Output is correct |
31 |
Correct |
321 ms |
490428 KB |
Output is correct |
32 |
Correct |
364 ms |
566144 KB |
Output is correct |
33 |
Correct |
352 ms |
566164 KB |
Output is correct |
34 |
Correct |
0 ms |
344 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
1 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
0 ms |
348 KB |
Output is correct |
45 |
Correct |
0 ms |
348 KB |
Output is correct |
46 |
Correct |
0 ms |
348 KB |
Output is correct |
47 |
Correct |
0 ms |
348 KB |
Output is correct |
48 |
Correct |
1 ms |
348 KB |
Output is correct |
49 |
Correct |
0 ms |
344 KB |
Output is correct |
50 |
Correct |
0 ms |
344 KB |
Output is correct |
51 |
Correct |
0 ms |
600 KB |
Output is correct |
52 |
Correct |
0 ms |
348 KB |
Output is correct |
53 |
Correct |
1 ms |
348 KB |
Output is correct |
54 |
Correct |
1 ms |
1116 KB |
Output is correct |
55 |
Correct |
1 ms |
860 KB |
Output is correct |
56 |
Correct |
1 ms |
860 KB |
Output is correct |
57 |
Correct |
1 ms |
860 KB |
Output is correct |
58 |
Correct |
1 ms |
860 KB |
Output is correct |
59 |
Correct |
1 ms |
860 KB |
Output is correct |
60 |
Correct |
1 ms |
860 KB |
Output is correct |
61 |
Correct |
1 ms |
860 KB |
Output is correct |
62 |
Correct |
1 ms |
856 KB |
Output is correct |
63 |
Correct |
1 ms |
860 KB |
Output is correct |
64 |
Correct |
0 ms |
604 KB |
Output is correct |
65 |
Correct |
1 ms |
348 KB |
Output is correct |
66 |
Correct |
1 ms |
348 KB |
Output is correct |
67 |
Correct |
3 ms |
948 KB |
Output is correct |
68 |
Correct |
2 ms |
1116 KB |
Output is correct |
69 |
Correct |
3 ms |
1884 KB |
Output is correct |
70 |
Correct |
5 ms |
1884 KB |
Output is correct |
71 |
Correct |
10 ms |
15964 KB |
Output is correct |
72 |
Correct |
15 ms |
13916 KB |
Output is correct |
73 |
Correct |
8 ms |
13144 KB |
Output is correct |
74 |
Correct |
9 ms |
14172 KB |
Output is correct |
75 |
Correct |
9 ms |
15964 KB |
Output is correct |
76 |
Correct |
9 ms |
13404 KB |
Output is correct |
77 |
Correct |
10 ms |
15964 KB |
Output is correct |
78 |
Correct |
9 ms |
14940 KB |
Output is correct |
79 |
Correct |
11 ms |
14644 KB |
Output is correct |
80 |
Correct |
16 ms |
15192 KB |
Output is correct |
81 |
Correct |
11 ms |
9816 KB |
Output is correct |
82 |
Correct |
11 ms |
11100 KB |
Output is correct |
83 |
Correct |
3 ms |
1104 KB |
Output is correct |
84 |
Correct |
4 ms |
676 KB |
Output is correct |
85 |
Correct |
45 ms |
5232 KB |
Output is correct |
86 |
Correct |
10 ms |
1160 KB |
Output is correct |
87 |
Correct |
15 ms |
1920 KB |
Output is correct |
88 |
Correct |
15 ms |
2024 KB |
Output is correct |
89 |
Correct |
375 ms |
566016 KB |
Output is correct |
90 |
Correct |
346 ms |
468800 KB |
Output is correct |
91 |
Correct |
379 ms |
563348 KB |
Output is correct |
92 |
Correct |
322 ms |
491648 KB |
Output is correct |
93 |
Correct |
299 ms |
496948 KB |
Output is correct |
94 |
Correct |
344 ms |
515744 KB |
Output is correct |
95 |
Correct |
395 ms |
540340 KB |
Output is correct |
96 |
Correct |
314 ms |
472392 KB |
Output is correct |
97 |
Correct |
357 ms |
538964 KB |
Output is correct |
98 |
Correct |
341 ms |
520052 KB |
Output is correct |
99 |
Correct |
346 ms |
566096 KB |
Output is correct |
100 |
Correct |
234 ms |
276304 KB |
Output is correct |
101 |
Correct |
38 ms |
16168 KB |
Output is correct |
102 |
Correct |
606 ms |
6172 KB |
Output is correct |
103 |
Execution timed out |
1051 ms |
15752 KB |
Time limit exceeded |
104 |
Halted |
0 ms |
0 KB |
- |