#include "closing.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
vector<pll> T[202020];
ll X[202020], Y[202020];
int n; ll l;
void dfs(int u, int p, ll *X) {
for (auto &[v, w]: T[u]) if (v != p) {
X[v] = X[u] + w;
dfs(v, u, X);
}
}
int solve1(ll k) {
vector<ll> V;
int i;
for (i = 0; i < n; i++) {
V.push_back(X[i]);
V.push_back(Y[i]);
}
sort(V.begin(), V.end());
for (i = 0; i < n + n; i++) {
k -= V[i];
if (k < 0) break;
}
return i;
}
ll D[6060];
int solve2(ll k) {
priority_queue<pll> P01, P02, P10, P12, P21;
vector<ll> C(n, 0);
int i;
for (i = 0; i < n; i++) {
if (X[i] > Y[i]) swap(X[i], Y[i]);
if (X[i] + Y[i] == l) {
k -= X[i]; Y[i] -= X[i]; X[i] = 0;
}
Y[i] -= X[i];
P01.emplace(-X[i], i);
P02.emplace(-X[i] - Y[i], i);
}
if (k < 0) return 0;
for (i = 0; i < n + n; i++) {
ll m = -1e18; int f;
for (; !P01.empty() && C[P01.top().second] != 0; P01.pop());
for (; !P02.empty() && C[P02.top().second] != 0; P02.pop());
for (; !P10.empty() && C[P10.top().second] != 1; P10.pop());
for (; !P12.empty() && C[P12.top().second] != 1; P12.pop());
for (; !P21.empty() && C[P21.top().second] != 2; P21.pop());
if (!P01.empty()) {
auto [t, _] = P01.top();
if (m < t) m = t, f = 1;
}
if (!P12.empty()) {
auto [t, _] = P12.top();
if (m < t) m = t, f = 2;
}
if (!P10.empty() && !P02.empty()) {
auto [t1, _] = P10.top();
auto [t2, __] = P02.top();
ll t = t1 + t2;
if (m < t) m = t, f = 3;
}
if (!P21.empty() && !P02.empty()) {
auto [t1, _] = P21.top();
auto [t2, __] = P02.top();
ll t = t1 + t2;
if (m < t) m = t, f = 4;
}
k += m;
if (k < 0) break;
if (f == 1) {
auto [t, j] = P01.top(); P01.pop();
P10.emplace(X[j], j);
P12.emplace(-Y[j], j);
C[j] = 1;
} else if (f == 2) {
auto [t, j] = P12.top(); P12.pop();
P21.emplace(Y[j], j);
C[j] = 2;
} else if (f == 3) {
auto [t1, j1] = P10.top(); P10.pop();
P01.emplace(-X[j1], j1);
P02.emplace(-X[j1] - Y[j1], j1);
C[j1] = 0;
auto [t2, j2] = P02.top(); P02.pop();
C[j2] = 2;
} else if (f == 4) {
auto [t1, j1] = P21.top(); P21.pop();
P10.emplace(X[j1], j1);
P12.emplace(-Y[j1], j1);
C[j1] = 1;
auto [t2, j2] = P02.top(); P02.pop();
P21.emplace(Y[j2], j2);
C[j2] = 2;
}
}
return i;
}
int max_score(int n, int x, int y, ll k, vector<int> U, vector<int> V, vector<int> W) {
::n = n;
int i;
for (i = 0; i < n; i++) {
T[i].clear();
}
for (i = 0; i < n - 1; i++) {
T[U[i]].emplace_back(V[i], W[i]);
T[V[i]].emplace_back(U[i], W[i]);
}
X[x] = Y[y] = 0;
dfs(x, x, X); dfs(y, y, Y);
l = X[y];
int a = solve1(k);
a = max(a, solve2(k));
return a;
}
Compilation message
closing.cpp: In function 'int solve2(ll)':
closing.cpp:94:16: warning: 'f' may be used uninitialized in this function [-Wmaybe-uninitialized]
94 | } else if (f == 3) {
| ^~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
8028 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
130 ms |
40932 KB |
Output is correct |
2 |
Correct |
145 ms |
45772 KB |
Output is correct |
3 |
Correct |
71 ms |
10836 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
8028 KB |
Output is correct |
2 |
Correct |
2 ms |
8028 KB |
Output is correct |
3 |
Correct |
2 ms |
8028 KB |
Output is correct |
4 |
Correct |
2 ms |
8028 KB |
Output is correct |
5 |
Correct |
2 ms |
8028 KB |
Output is correct |
6 |
Correct |
2 ms |
8028 KB |
Output is correct |
7 |
Correct |
2 ms |
8028 KB |
Output is correct |
8 |
Correct |
2 ms |
8184 KB |
Output is correct |
9 |
Correct |
2 ms |
8028 KB |
Output is correct |
10 |
Correct |
2 ms |
8028 KB |
Output is correct |
11 |
Correct |
2 ms |
8028 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
8028 KB |
Output is correct |
2 |
Correct |
2 ms |
8028 KB |
Output is correct |
3 |
Correct |
2 ms |
8028 KB |
Output is correct |
4 |
Correct |
2 ms |
8028 KB |
Output is correct |
5 |
Correct |
2 ms |
8028 KB |
Output is correct |
6 |
Correct |
2 ms |
8028 KB |
Output is correct |
7 |
Correct |
2 ms |
8028 KB |
Output is correct |
8 |
Correct |
2 ms |
8184 KB |
Output is correct |
9 |
Correct |
2 ms |
8028 KB |
Output is correct |
10 |
Correct |
2 ms |
8028 KB |
Output is correct |
11 |
Correct |
2 ms |
8028 KB |
Output is correct |
12 |
Correct |
2 ms |
8024 KB |
Output is correct |
13 |
Correct |
2 ms |
8028 KB |
Output is correct |
14 |
Correct |
2 ms |
8024 KB |
Output is correct |
15 |
Correct |
2 ms |
8028 KB |
Output is correct |
16 |
Correct |
2 ms |
8028 KB |
Output is correct |
17 |
Correct |
2 ms |
8028 KB |
Output is correct |
18 |
Correct |
2 ms |
8028 KB |
Output is correct |
19 |
Correct |
2 ms |
8280 KB |
Output is correct |
20 |
Correct |
2 ms |
8284 KB |
Output is correct |
21 |
Correct |
2 ms |
8284 KB |
Output is correct |
22 |
Correct |
2 ms |
8280 KB |
Output is correct |
23 |
Correct |
3 ms |
8284 KB |
Output is correct |
24 |
Correct |
2 ms |
8284 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
8028 KB |
Output is correct |
2 |
Correct |
2 ms |
8028 KB |
Output is correct |
3 |
Correct |
2 ms |
8028 KB |
Output is correct |
4 |
Correct |
2 ms |
8028 KB |
Output is correct |
5 |
Correct |
2 ms |
8028 KB |
Output is correct |
6 |
Correct |
2 ms |
8028 KB |
Output is correct |
7 |
Correct |
2 ms |
8028 KB |
Output is correct |
8 |
Correct |
2 ms |
8184 KB |
Output is correct |
9 |
Correct |
2 ms |
8028 KB |
Output is correct |
10 |
Correct |
2 ms |
8028 KB |
Output is correct |
11 |
Correct |
2 ms |
8028 KB |
Output is correct |
12 |
Correct |
2 ms |
8024 KB |
Output is correct |
13 |
Correct |
2 ms |
8028 KB |
Output is correct |
14 |
Correct |
2 ms |
8024 KB |
Output is correct |
15 |
Correct |
2 ms |
8028 KB |
Output is correct |
16 |
Correct |
2 ms |
8028 KB |
Output is correct |
17 |
Correct |
2 ms |
8028 KB |
Output is correct |
18 |
Correct |
2 ms |
8028 KB |
Output is correct |
19 |
Correct |
2 ms |
8280 KB |
Output is correct |
20 |
Correct |
2 ms |
8284 KB |
Output is correct |
21 |
Correct |
2 ms |
8284 KB |
Output is correct |
22 |
Correct |
2 ms |
8280 KB |
Output is correct |
23 |
Correct |
3 ms |
8284 KB |
Output is correct |
24 |
Correct |
2 ms |
8284 KB |
Output is correct |
25 |
Correct |
3 ms |
8028 KB |
Output is correct |
26 |
Correct |
4 ms |
8796 KB |
Output is correct |
27 |
Correct |
4 ms |
8536 KB |
Output is correct |
28 |
Correct |
4 ms |
8796 KB |
Output is correct |
29 |
Correct |
4 ms |
8796 KB |
Output is correct |
30 |
Correct |
3 ms |
8540 KB |
Output is correct |
31 |
Correct |
3 ms |
8796 KB |
Output is correct |
32 |
Correct |
4 ms |
8792 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
8028 KB |
Output is correct |
2 |
Correct |
2 ms |
8028 KB |
Output is correct |
3 |
Correct |
2 ms |
8028 KB |
Output is correct |
4 |
Correct |
2 ms |
8028 KB |
Output is correct |
5 |
Correct |
2 ms |
8028 KB |
Output is correct |
6 |
Correct |
2 ms |
8028 KB |
Output is correct |
7 |
Correct |
2 ms |
8280 KB |
Output is correct |
8 |
Correct |
2 ms |
8028 KB |
Output is correct |
9 |
Correct |
2 ms |
8028 KB |
Output is correct |
10 |
Correct |
2 ms |
8028 KB |
Output is correct |
11 |
Correct |
2 ms |
8028 KB |
Output is correct |
12 |
Correct |
3 ms |
8116 KB |
Output is correct |
13 |
Correct |
2 ms |
8028 KB |
Output is correct |
14 |
Correct |
2 ms |
8024 KB |
Output is correct |
15 |
Correct |
2 ms |
8024 KB |
Output is correct |
16 |
Correct |
2 ms |
8028 KB |
Output is correct |
17 |
Correct |
2 ms |
8028 KB |
Output is correct |
18 |
Correct |
2 ms |
8028 KB |
Output is correct |
19 |
Correct |
2 ms |
8028 KB |
Output is correct |
20 |
Correct |
3 ms |
8028 KB |
Output is correct |
21 |
Correct |
2 ms |
8028 KB |
Output is correct |
22 |
Correct |
2 ms |
8028 KB |
Output is correct |
23 |
Correct |
2 ms |
8028 KB |
Output is correct |
24 |
Correct |
3 ms |
8024 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
8028 KB |
Output is correct |
2 |
Correct |
2 ms |
8028 KB |
Output is correct |
3 |
Correct |
2 ms |
8028 KB |
Output is correct |
4 |
Correct |
2 ms |
8028 KB |
Output is correct |
5 |
Correct |
2 ms |
8028 KB |
Output is correct |
6 |
Correct |
2 ms |
8028 KB |
Output is correct |
7 |
Correct |
2 ms |
8028 KB |
Output is correct |
8 |
Correct |
2 ms |
8028 KB |
Output is correct |
9 |
Correct |
2 ms |
8184 KB |
Output is correct |
10 |
Correct |
2 ms |
8028 KB |
Output is correct |
11 |
Correct |
2 ms |
8028 KB |
Output is correct |
12 |
Correct |
2 ms |
8028 KB |
Output is correct |
13 |
Correct |
2 ms |
8024 KB |
Output is correct |
14 |
Correct |
2 ms |
8028 KB |
Output is correct |
15 |
Correct |
2 ms |
8024 KB |
Output is correct |
16 |
Correct |
2 ms |
8028 KB |
Output is correct |
17 |
Correct |
2 ms |
8028 KB |
Output is correct |
18 |
Correct |
2 ms |
8028 KB |
Output is correct |
19 |
Correct |
2 ms |
8280 KB |
Output is correct |
20 |
Correct |
2 ms |
8028 KB |
Output is correct |
21 |
Correct |
2 ms |
8028 KB |
Output is correct |
22 |
Correct |
2 ms |
8028 KB |
Output is correct |
23 |
Correct |
2 ms |
8028 KB |
Output is correct |
24 |
Correct |
3 ms |
8116 KB |
Output is correct |
25 |
Correct |
2 ms |
8028 KB |
Output is correct |
26 |
Correct |
2 ms |
8024 KB |
Output is correct |
27 |
Correct |
2 ms |
8024 KB |
Output is correct |
28 |
Correct |
2 ms |
8028 KB |
Output is correct |
29 |
Correct |
2 ms |
8028 KB |
Output is correct |
30 |
Correct |
2 ms |
8028 KB |
Output is correct |
31 |
Correct |
2 ms |
8028 KB |
Output is correct |
32 |
Correct |
3 ms |
8028 KB |
Output is correct |
33 |
Correct |
2 ms |
8028 KB |
Output is correct |
34 |
Correct |
2 ms |
8028 KB |
Output is correct |
35 |
Correct |
2 ms |
8028 KB |
Output is correct |
36 |
Correct |
3 ms |
8024 KB |
Output is correct |
37 |
Correct |
2 ms |
8024 KB |
Output is correct |
38 |
Correct |
2 ms |
8028 KB |
Output is correct |
39 |
Correct |
2 ms |
8028 KB |
Output is correct |
40 |
Correct |
2 ms |
8024 KB |
Output is correct |
41 |
Correct |
2 ms |
8028 KB |
Output is correct |
42 |
Correct |
2 ms |
8028 KB |
Output is correct |
43 |
Correct |
2 ms |
8028 KB |
Output is correct |
44 |
Correct |
2 ms |
8028 KB |
Output is correct |
45 |
Correct |
2 ms |
8028 KB |
Output is correct |
46 |
Correct |
2 ms |
8024 KB |
Output is correct |
47 |
Correct |
2 ms |
8028 KB |
Output is correct |
48 |
Correct |
2 ms |
8092 KB |
Output is correct |
49 |
Correct |
2 ms |
8028 KB |
Output is correct |
50 |
Correct |
2 ms |
8028 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
8028 KB |
Output is correct |
2 |
Correct |
2 ms |
8028 KB |
Output is correct |
3 |
Correct |
2 ms |
8028 KB |
Output is correct |
4 |
Correct |
2 ms |
8028 KB |
Output is correct |
5 |
Correct |
2 ms |
8028 KB |
Output is correct |
6 |
Correct |
2 ms |
8028 KB |
Output is correct |
7 |
Correct |
2 ms |
8028 KB |
Output is correct |
8 |
Correct |
2 ms |
8028 KB |
Output is correct |
9 |
Correct |
2 ms |
8184 KB |
Output is correct |
10 |
Correct |
2 ms |
8028 KB |
Output is correct |
11 |
Correct |
2 ms |
8028 KB |
Output is correct |
12 |
Correct |
2 ms |
8028 KB |
Output is correct |
13 |
Correct |
2 ms |
8024 KB |
Output is correct |
14 |
Correct |
2 ms |
8028 KB |
Output is correct |
15 |
Correct |
2 ms |
8024 KB |
Output is correct |
16 |
Correct |
2 ms |
8028 KB |
Output is correct |
17 |
Correct |
2 ms |
8028 KB |
Output is correct |
18 |
Correct |
2 ms |
8028 KB |
Output is correct |
19 |
Correct |
2 ms |
8028 KB |
Output is correct |
20 |
Correct |
2 ms |
8280 KB |
Output is correct |
21 |
Correct |
2 ms |
8284 KB |
Output is correct |
22 |
Correct |
2 ms |
8284 KB |
Output is correct |
23 |
Correct |
2 ms |
8280 KB |
Output is correct |
24 |
Correct |
3 ms |
8284 KB |
Output is correct |
25 |
Correct |
2 ms |
8284 KB |
Output is correct |
26 |
Correct |
2 ms |
8280 KB |
Output is correct |
27 |
Correct |
2 ms |
8028 KB |
Output is correct |
28 |
Correct |
2 ms |
8028 KB |
Output is correct |
29 |
Correct |
2 ms |
8028 KB |
Output is correct |
30 |
Correct |
2 ms |
8028 KB |
Output is correct |
31 |
Correct |
3 ms |
8116 KB |
Output is correct |
32 |
Correct |
2 ms |
8028 KB |
Output is correct |
33 |
Correct |
2 ms |
8024 KB |
Output is correct |
34 |
Correct |
2 ms |
8024 KB |
Output is correct |
35 |
Correct |
2 ms |
8028 KB |
Output is correct |
36 |
Correct |
2 ms |
8028 KB |
Output is correct |
37 |
Correct |
2 ms |
8028 KB |
Output is correct |
38 |
Correct |
2 ms |
8028 KB |
Output is correct |
39 |
Correct |
3 ms |
8028 KB |
Output is correct |
40 |
Correct |
2 ms |
8028 KB |
Output is correct |
41 |
Correct |
2 ms |
8028 KB |
Output is correct |
42 |
Correct |
2 ms |
8028 KB |
Output is correct |
43 |
Correct |
3 ms |
8024 KB |
Output is correct |
44 |
Correct |
2 ms |
8024 KB |
Output is correct |
45 |
Correct |
2 ms |
8028 KB |
Output is correct |
46 |
Correct |
2 ms |
8028 KB |
Output is correct |
47 |
Correct |
2 ms |
8024 KB |
Output is correct |
48 |
Correct |
2 ms |
8028 KB |
Output is correct |
49 |
Correct |
2 ms |
8028 KB |
Output is correct |
50 |
Correct |
2 ms |
8028 KB |
Output is correct |
51 |
Correct |
2 ms |
8028 KB |
Output is correct |
52 |
Correct |
2 ms |
8028 KB |
Output is correct |
53 |
Correct |
2 ms |
8024 KB |
Output is correct |
54 |
Correct |
2 ms |
8028 KB |
Output is correct |
55 |
Correct |
2 ms |
8092 KB |
Output is correct |
56 |
Correct |
2 ms |
8028 KB |
Output is correct |
57 |
Correct |
2 ms |
8028 KB |
Output is correct |
58 |
Correct |
2 ms |
8028 KB |
Output is correct |
59 |
Correct |
2 ms |
8028 KB |
Output is correct |
60 |
Correct |
2 ms |
8024 KB |
Output is correct |
61 |
Correct |
2 ms |
8028 KB |
Output is correct |
62 |
Correct |
3 ms |
8028 KB |
Output is correct |
63 |
Correct |
2 ms |
8284 KB |
Output is correct |
64 |
Correct |
2 ms |
8280 KB |
Output is correct |
65 |
Correct |
3 ms |
8284 KB |
Output is correct |
66 |
Correct |
2 ms |
8288 KB |
Output is correct |
67 |
Correct |
3 ms |
8284 KB |
Output is correct |
68 |
Correct |
2 ms |
8284 KB |
Output is correct |
69 |
Correct |
2 ms |
8284 KB |
Output is correct |
70 |
Correct |
2 ms |
8284 KB |
Output is correct |
71 |
Correct |
3 ms |
8084 KB |
Output is correct |
72 |
Correct |
2 ms |
8280 KB |
Output is correct |
73 |
Correct |
3 ms |
8284 KB |
Output is correct |
74 |
Correct |
3 ms |
8284 KB |
Output is correct |
75 |
Correct |
2 ms |
8028 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
8028 KB |
Output is correct |
2 |
Correct |
2 ms |
8028 KB |
Output is correct |
3 |
Correct |
2 ms |
8028 KB |
Output is correct |
4 |
Correct |
2 ms |
8028 KB |
Output is correct |
5 |
Correct |
2 ms |
8028 KB |
Output is correct |
6 |
Correct |
2 ms |
8028 KB |
Output is correct |
7 |
Correct |
2 ms |
8028 KB |
Output is correct |
8 |
Correct |
2 ms |
8028 KB |
Output is correct |
9 |
Correct |
2 ms |
8184 KB |
Output is correct |
10 |
Correct |
2 ms |
8028 KB |
Output is correct |
11 |
Correct |
2 ms |
8028 KB |
Output is correct |
12 |
Correct |
2 ms |
8028 KB |
Output is correct |
13 |
Correct |
2 ms |
8024 KB |
Output is correct |
14 |
Correct |
2 ms |
8028 KB |
Output is correct |
15 |
Correct |
2 ms |
8024 KB |
Output is correct |
16 |
Correct |
2 ms |
8028 KB |
Output is correct |
17 |
Correct |
2 ms |
8028 KB |
Output is correct |
18 |
Correct |
2 ms |
8028 KB |
Output is correct |
19 |
Correct |
2 ms |
8028 KB |
Output is correct |
20 |
Correct |
2 ms |
8280 KB |
Output is correct |
21 |
Correct |
2 ms |
8284 KB |
Output is correct |
22 |
Correct |
2 ms |
8284 KB |
Output is correct |
23 |
Correct |
2 ms |
8280 KB |
Output is correct |
24 |
Correct |
3 ms |
8284 KB |
Output is correct |
25 |
Correct |
2 ms |
8284 KB |
Output is correct |
26 |
Correct |
3 ms |
8028 KB |
Output is correct |
27 |
Correct |
4 ms |
8796 KB |
Output is correct |
28 |
Correct |
4 ms |
8536 KB |
Output is correct |
29 |
Correct |
4 ms |
8796 KB |
Output is correct |
30 |
Correct |
4 ms |
8796 KB |
Output is correct |
31 |
Correct |
3 ms |
8540 KB |
Output is correct |
32 |
Correct |
3 ms |
8796 KB |
Output is correct |
33 |
Correct |
4 ms |
8792 KB |
Output is correct |
34 |
Correct |
2 ms |
8280 KB |
Output is correct |
35 |
Correct |
2 ms |
8028 KB |
Output is correct |
36 |
Correct |
2 ms |
8028 KB |
Output is correct |
37 |
Correct |
2 ms |
8028 KB |
Output is correct |
38 |
Correct |
2 ms |
8028 KB |
Output is correct |
39 |
Correct |
3 ms |
8116 KB |
Output is correct |
40 |
Correct |
2 ms |
8028 KB |
Output is correct |
41 |
Correct |
2 ms |
8024 KB |
Output is correct |
42 |
Correct |
2 ms |
8024 KB |
Output is correct |
43 |
Correct |
2 ms |
8028 KB |
Output is correct |
44 |
Correct |
2 ms |
8028 KB |
Output is correct |
45 |
Correct |
2 ms |
8028 KB |
Output is correct |
46 |
Correct |
2 ms |
8028 KB |
Output is correct |
47 |
Correct |
3 ms |
8028 KB |
Output is correct |
48 |
Correct |
2 ms |
8028 KB |
Output is correct |
49 |
Correct |
2 ms |
8028 KB |
Output is correct |
50 |
Correct |
2 ms |
8028 KB |
Output is correct |
51 |
Correct |
3 ms |
8024 KB |
Output is correct |
52 |
Correct |
2 ms |
8024 KB |
Output is correct |
53 |
Correct |
2 ms |
8028 KB |
Output is correct |
54 |
Correct |
2 ms |
8028 KB |
Output is correct |
55 |
Correct |
2 ms |
8024 KB |
Output is correct |
56 |
Correct |
2 ms |
8028 KB |
Output is correct |
57 |
Correct |
2 ms |
8028 KB |
Output is correct |
58 |
Correct |
2 ms |
8028 KB |
Output is correct |
59 |
Correct |
2 ms |
8028 KB |
Output is correct |
60 |
Correct |
2 ms |
8028 KB |
Output is correct |
61 |
Correct |
2 ms |
8024 KB |
Output is correct |
62 |
Correct |
2 ms |
8028 KB |
Output is correct |
63 |
Correct |
2 ms |
8092 KB |
Output is correct |
64 |
Correct |
2 ms |
8028 KB |
Output is correct |
65 |
Correct |
2 ms |
8028 KB |
Output is correct |
66 |
Correct |
2 ms |
8028 KB |
Output is correct |
67 |
Correct |
2 ms |
8028 KB |
Output is correct |
68 |
Correct |
2 ms |
8024 KB |
Output is correct |
69 |
Correct |
2 ms |
8028 KB |
Output is correct |
70 |
Correct |
3 ms |
8028 KB |
Output is correct |
71 |
Correct |
2 ms |
8284 KB |
Output is correct |
72 |
Correct |
2 ms |
8280 KB |
Output is correct |
73 |
Correct |
3 ms |
8284 KB |
Output is correct |
74 |
Correct |
2 ms |
8288 KB |
Output is correct |
75 |
Correct |
3 ms |
8284 KB |
Output is correct |
76 |
Correct |
2 ms |
8284 KB |
Output is correct |
77 |
Correct |
2 ms |
8284 KB |
Output is correct |
78 |
Correct |
2 ms |
8284 KB |
Output is correct |
79 |
Correct |
3 ms |
8084 KB |
Output is correct |
80 |
Correct |
2 ms |
8280 KB |
Output is correct |
81 |
Correct |
3 ms |
8284 KB |
Output is correct |
82 |
Correct |
3 ms |
8284 KB |
Output is correct |
83 |
Correct |
2 ms |
8028 KB |
Output is correct |
84 |
Correct |
5 ms |
8540 KB |
Output is correct |
85 |
Correct |
3 ms |
8284 KB |
Output is correct |
86 |
Correct |
3 ms |
8284 KB |
Output is correct |
87 |
Correct |
3 ms |
8280 KB |
Output is correct |
88 |
Correct |
3 ms |
8252 KB |
Output is correct |
89 |
Correct |
4 ms |
8540 KB |
Output is correct |
90 |
Correct |
4 ms |
8540 KB |
Output is correct |
91 |
Correct |
3 ms |
8540 KB |
Output is correct |
92 |
Correct |
4 ms |
8792 KB |
Output is correct |
93 |
Correct |
4 ms |
8536 KB |
Output is correct |
94 |
Correct |
3 ms |
8796 KB |
Output is correct |
95 |
Correct |
4 ms |
8796 KB |
Output is correct |
96 |
Correct |
3 ms |
8540 KB |
Output is correct |
97 |
Correct |
4 ms |
8640 KB |
Output is correct |
98 |
Correct |
3 ms |
8536 KB |
Output is correct |
99 |
Correct |
4 ms |
8540 KB |
Output is correct |
100 |
Correct |
3 ms |
8540 KB |
Output is correct |
101 |
Correct |
4 ms |
8284 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
8028 KB |
Output is correct |
2 |
Correct |
2 ms |
8028 KB |
Output is correct |
3 |
Correct |
2 ms |
8028 KB |
Output is correct |
4 |
Correct |
2 ms |
8028 KB |
Output is correct |
5 |
Correct |
2 ms |
8028 KB |
Output is correct |
6 |
Correct |
2 ms |
8028 KB |
Output is correct |
7 |
Correct |
2 ms |
8028 KB |
Output is correct |
8 |
Correct |
2 ms |
8028 KB |
Output is correct |
9 |
Correct |
2 ms |
8184 KB |
Output is correct |
10 |
Correct |
2 ms |
8028 KB |
Output is correct |
11 |
Correct |
2 ms |
8028 KB |
Output is correct |
12 |
Correct |
2 ms |
8028 KB |
Output is correct |
13 |
Correct |
2 ms |
8024 KB |
Output is correct |
14 |
Correct |
2 ms |
8028 KB |
Output is correct |
15 |
Correct |
2 ms |
8024 KB |
Output is correct |
16 |
Correct |
2 ms |
8028 KB |
Output is correct |
17 |
Correct |
2 ms |
8028 KB |
Output is correct |
18 |
Correct |
2 ms |
8028 KB |
Output is correct |
19 |
Correct |
2 ms |
8028 KB |
Output is correct |
20 |
Correct |
2 ms |
8280 KB |
Output is correct |
21 |
Correct |
2 ms |
8284 KB |
Output is correct |
22 |
Correct |
2 ms |
8284 KB |
Output is correct |
23 |
Correct |
2 ms |
8280 KB |
Output is correct |
24 |
Correct |
3 ms |
8284 KB |
Output is correct |
25 |
Correct |
2 ms |
8284 KB |
Output is correct |
26 |
Correct |
3 ms |
8028 KB |
Output is correct |
27 |
Correct |
4 ms |
8796 KB |
Output is correct |
28 |
Correct |
4 ms |
8536 KB |
Output is correct |
29 |
Correct |
4 ms |
8796 KB |
Output is correct |
30 |
Correct |
4 ms |
8796 KB |
Output is correct |
31 |
Correct |
3 ms |
8540 KB |
Output is correct |
32 |
Correct |
3 ms |
8796 KB |
Output is correct |
33 |
Correct |
4 ms |
8792 KB |
Output is correct |
34 |
Correct |
2 ms |
8280 KB |
Output is correct |
35 |
Correct |
2 ms |
8028 KB |
Output is correct |
36 |
Correct |
2 ms |
8028 KB |
Output is correct |
37 |
Correct |
2 ms |
8028 KB |
Output is correct |
38 |
Correct |
2 ms |
8028 KB |
Output is correct |
39 |
Correct |
3 ms |
8116 KB |
Output is correct |
40 |
Correct |
2 ms |
8028 KB |
Output is correct |
41 |
Correct |
2 ms |
8024 KB |
Output is correct |
42 |
Correct |
2 ms |
8024 KB |
Output is correct |
43 |
Correct |
2 ms |
8028 KB |
Output is correct |
44 |
Correct |
2 ms |
8028 KB |
Output is correct |
45 |
Correct |
2 ms |
8028 KB |
Output is correct |
46 |
Correct |
2 ms |
8028 KB |
Output is correct |
47 |
Correct |
3 ms |
8028 KB |
Output is correct |
48 |
Correct |
2 ms |
8028 KB |
Output is correct |
49 |
Correct |
2 ms |
8028 KB |
Output is correct |
50 |
Correct |
2 ms |
8028 KB |
Output is correct |
51 |
Correct |
3 ms |
8024 KB |
Output is correct |
52 |
Correct |
2 ms |
8024 KB |
Output is correct |
53 |
Correct |
2 ms |
8028 KB |
Output is correct |
54 |
Correct |
2 ms |
8028 KB |
Output is correct |
55 |
Correct |
2 ms |
8024 KB |
Output is correct |
56 |
Correct |
2 ms |
8028 KB |
Output is correct |
57 |
Correct |
2 ms |
8028 KB |
Output is correct |
58 |
Correct |
2 ms |
8028 KB |
Output is correct |
59 |
Correct |
2 ms |
8028 KB |
Output is correct |
60 |
Correct |
2 ms |
8028 KB |
Output is correct |
61 |
Correct |
2 ms |
8024 KB |
Output is correct |
62 |
Correct |
2 ms |
8028 KB |
Output is correct |
63 |
Correct |
2 ms |
8092 KB |
Output is correct |
64 |
Correct |
2 ms |
8028 KB |
Output is correct |
65 |
Correct |
2 ms |
8028 KB |
Output is correct |
66 |
Correct |
2 ms |
8028 KB |
Output is correct |
67 |
Correct |
2 ms |
8028 KB |
Output is correct |
68 |
Correct |
2 ms |
8024 KB |
Output is correct |
69 |
Correct |
2 ms |
8028 KB |
Output is correct |
70 |
Correct |
3 ms |
8028 KB |
Output is correct |
71 |
Correct |
2 ms |
8284 KB |
Output is correct |
72 |
Correct |
2 ms |
8280 KB |
Output is correct |
73 |
Correct |
3 ms |
8284 KB |
Output is correct |
74 |
Correct |
2 ms |
8288 KB |
Output is correct |
75 |
Correct |
3 ms |
8284 KB |
Output is correct |
76 |
Correct |
2 ms |
8284 KB |
Output is correct |
77 |
Correct |
2 ms |
8284 KB |
Output is correct |
78 |
Correct |
2 ms |
8284 KB |
Output is correct |
79 |
Correct |
3 ms |
8084 KB |
Output is correct |
80 |
Correct |
2 ms |
8280 KB |
Output is correct |
81 |
Correct |
3 ms |
8284 KB |
Output is correct |
82 |
Correct |
3 ms |
8284 KB |
Output is correct |
83 |
Correct |
2 ms |
8028 KB |
Output is correct |
84 |
Correct |
5 ms |
8540 KB |
Output is correct |
85 |
Correct |
3 ms |
8284 KB |
Output is correct |
86 |
Correct |
3 ms |
8284 KB |
Output is correct |
87 |
Correct |
3 ms |
8280 KB |
Output is correct |
88 |
Correct |
3 ms |
8252 KB |
Output is correct |
89 |
Correct |
4 ms |
8540 KB |
Output is correct |
90 |
Correct |
4 ms |
8540 KB |
Output is correct |
91 |
Correct |
3 ms |
8540 KB |
Output is correct |
92 |
Correct |
4 ms |
8792 KB |
Output is correct |
93 |
Correct |
4 ms |
8536 KB |
Output is correct |
94 |
Correct |
3 ms |
8796 KB |
Output is correct |
95 |
Correct |
4 ms |
8796 KB |
Output is correct |
96 |
Correct |
3 ms |
8540 KB |
Output is correct |
97 |
Correct |
4 ms |
8640 KB |
Output is correct |
98 |
Correct |
3 ms |
8536 KB |
Output is correct |
99 |
Correct |
4 ms |
8540 KB |
Output is correct |
100 |
Correct |
3 ms |
8540 KB |
Output is correct |
101 |
Correct |
4 ms |
8284 KB |
Output is correct |
102 |
Correct |
103 ms |
10836 KB |
Output is correct |
103 |
Correct |
121 ms |
10736 KB |
Output is correct |
104 |
Correct |
238 ms |
50336 KB |
Output is correct |
105 |
Correct |
92 ms |
15312 KB |
Output is correct |
106 |
Correct |
102 ms |
14912 KB |
Output is correct |
107 |
Correct |
124 ms |
44740 KB |
Output is correct |
108 |
Correct |
130 ms |
49704 KB |
Output is correct |
109 |
Correct |
100 ms |
50508 KB |
Output is correct |
110 |
Correct |
194 ms |
43784 KB |
Output is correct |
111 |
Correct |
133 ms |
47620 KB |
Output is correct |
112 |
Correct |
144 ms |
40636 KB |
Output is correct |
113 |
Correct |
130 ms |
39456 KB |
Output is correct |
114 |
Correct |
130 ms |
39824 KB |
Output is correct |
115 |
Correct |
154 ms |
60964 KB |
Output is correct |
116 |
Correct |
192 ms |
43136 KB |
Output is correct |
117 |
Correct |
177 ms |
44368 KB |
Output is correct |
118 |
Correct |
157 ms |
41056 KB |
Output is correct |
119 |
Correct |
149 ms |
18716 KB |
Output is correct |
120 |
Correct |
95 ms |
12936 KB |
Output is correct |