#include <bits/stdc++.h>
using namespace std;
#define sz(x) int(x.size())
#define all(x) begin(x), end(x)
using ll = long long;
using ii = pair<int, int>;
const ll INF = 1e18;
const int MAX_N = 2e5 + 9;
vector<ii> adj[MAX_N];
int n;
void dfs(int u, vector<ll> &dist, int p = -1, ll d = 0) {
dist[u] = d;
for (auto [v, w] : adj[u]) {
if (v != p) dfs(v, dist, u, d + w);
}
}
int non_overlaping(ll K, vector<ll> v) {
sort(all(v));
int ans = 0;
for (int i = 0; i < n; i++) {
if (v[i] <= K) {
K -= v[i];
ans++;
}
}
return ans;
}
int max_score(int N, int X, int Y, ll K, vector<int> U, vector<int> V, vector<int> W) {
n = N;
for (int i = 0; i < n; i++) adj[i].clear();
for (int i = 0; i < n - 1; i++) {
adj[U[i]].emplace_back(V[i], W[i]);
adj[V[i]].emplace_back(U[i], W[i]);
}
vector<ll> dist1(n), dist2(n);
dfs(X, dist1), dfs(Y, dist2);
vector<bool> path(n, false);
path[Y] = true;
int u = Y;
while (u != X) {
for (auto [v, w] : adj[u]) {
if (dist1[v] + w == dist1[u]) {
u = v;
break;
}
}
path[u] = true;
}
for (int i = 0; i < n; i++) {
if (dist1[i] > dist2[i]) swap(dist1[i], dist2[i]);
}
vector<ll> vec1;
vector<pair<ll, ll>> vec2;
ll remain = K;
int curr = 0;
for (int i = 0; i < n; i++) {
ll val1 = dist1[i];
ll val2 = dist2[i] - dist1[i];
if (path[i]) {
remain -= val1, curr++;
vec1.push_back(val2);
} else if (val1 <= val2) {
vec1.push_back(val1);
vec1.push_back(val2);
} else {
vec2.emplace_back(val1, val2);
}
}
sort(all(vec1));
sort(all(vec2), [](const pair<ll, ll> &a, const pair<ll, ll> &b) {
return a.first + a.second < b.first + b.second;
});
int S = sz(vec1);
vector<ll> prefSum(S + 1);
prefSum[0] = 0LL;
for (int i = 0; i < S; i++) {
prefSum[i + 1] = vec1[i];
prefSum[i + 1] += prefSum[i];
}
int M = sz(vec2);
vector<ll> prefMaxi(M + 1);
prefMaxi[0] = -INF;
for (int i = 0; i < M; i++) {
prefMaxi[i + 1] = vec2[i].second;
prefMaxi[i + 1] = max(prefMaxi[i + 1], prefMaxi[i]);
}
vector<ll> suffMini(M + 2);
suffMini[M + 1] = suffMini[M] = INF;
for (int i = M - 1; i >= 0; i--) {
suffMini[i] = vec2[i].first;
suffMini[i] = min(suffMini[i], suffMini[i + 1]);
}
auto calc = [&](ll r) {
if (remain < 0) return int(-1e9);
auto it = upper_bound(all(prefSum), r);
return int(it - prefSum.begin()) - 1;
};
int ans = non_overlaping(K, dist1);
for (int i = 0; i <= M; i++) {
if (i > 0) {
remain -= vec2[i - 1].first + vec2[i - 1].second;
curr += 2;
}
ans = max({ans, curr + calc(remain),
curr + 1 + calc(remain - suffMini[i]),
curr - 1 + calc(remain + prefMaxi[i])});
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
4952 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
101 ms |
29616 KB |
Output is correct |
2 |
Correct |
117 ms |
30148 KB |
Output is correct |
3 |
Correct |
58 ms |
7712 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
4956 KB |
Output is correct |
2 |
Correct |
1 ms |
4956 KB |
Output is correct |
3 |
Correct |
1 ms |
4956 KB |
Output is correct |
4 |
Correct |
1 ms |
4964 KB |
Output is correct |
5 |
Correct |
1 ms |
4956 KB |
Output is correct |
6 |
Correct |
1 ms |
4956 KB |
Output is correct |
7 |
Correct |
1 ms |
4956 KB |
Output is correct |
8 |
Correct |
1 ms |
4956 KB |
Output is correct |
9 |
Correct |
1 ms |
4956 KB |
Output is correct |
10 |
Correct |
1 ms |
4956 KB |
Output is correct |
11 |
Correct |
1 ms |
4956 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
4956 KB |
Output is correct |
2 |
Correct |
1 ms |
4956 KB |
Output is correct |
3 |
Correct |
1 ms |
4956 KB |
Output is correct |
4 |
Correct |
1 ms |
4964 KB |
Output is correct |
5 |
Correct |
1 ms |
4956 KB |
Output is correct |
6 |
Correct |
1 ms |
4956 KB |
Output is correct |
7 |
Correct |
1 ms |
4956 KB |
Output is correct |
8 |
Correct |
1 ms |
4956 KB |
Output is correct |
9 |
Correct |
1 ms |
4956 KB |
Output is correct |
10 |
Correct |
1 ms |
4956 KB |
Output is correct |
11 |
Correct |
1 ms |
4956 KB |
Output is correct |
12 |
Correct |
2 ms |
4956 KB |
Output is correct |
13 |
Correct |
1 ms |
4956 KB |
Output is correct |
14 |
Correct |
1 ms |
4956 KB |
Output is correct |
15 |
Correct |
1 ms |
4956 KB |
Output is correct |
16 |
Correct |
1 ms |
4956 KB |
Output is correct |
17 |
Correct |
1 ms |
4956 KB |
Output is correct |
18 |
Correct |
1 ms |
5136 KB |
Output is correct |
19 |
Correct |
1 ms |
4952 KB |
Output is correct |
20 |
Correct |
1 ms |
4956 KB |
Output is correct |
21 |
Correct |
1 ms |
5140 KB |
Output is correct |
22 |
Correct |
1 ms |
4956 KB |
Output is correct |
23 |
Correct |
1 ms |
4956 KB |
Output is correct |
24 |
Correct |
1 ms |
4956 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
4956 KB |
Output is correct |
2 |
Correct |
1 ms |
4956 KB |
Output is correct |
3 |
Correct |
1 ms |
4956 KB |
Output is correct |
4 |
Correct |
1 ms |
4964 KB |
Output is correct |
5 |
Correct |
1 ms |
4956 KB |
Output is correct |
6 |
Correct |
1 ms |
4956 KB |
Output is correct |
7 |
Correct |
1 ms |
4956 KB |
Output is correct |
8 |
Correct |
1 ms |
4956 KB |
Output is correct |
9 |
Correct |
1 ms |
4956 KB |
Output is correct |
10 |
Correct |
1 ms |
4956 KB |
Output is correct |
11 |
Correct |
1 ms |
4956 KB |
Output is correct |
12 |
Correct |
2 ms |
4956 KB |
Output is correct |
13 |
Correct |
1 ms |
4956 KB |
Output is correct |
14 |
Correct |
1 ms |
4956 KB |
Output is correct |
15 |
Correct |
1 ms |
4956 KB |
Output is correct |
16 |
Correct |
1 ms |
4956 KB |
Output is correct |
17 |
Correct |
1 ms |
4956 KB |
Output is correct |
18 |
Correct |
1 ms |
5136 KB |
Output is correct |
19 |
Correct |
1 ms |
4952 KB |
Output is correct |
20 |
Correct |
1 ms |
4956 KB |
Output is correct |
21 |
Correct |
1 ms |
5140 KB |
Output is correct |
22 |
Correct |
1 ms |
4956 KB |
Output is correct |
23 |
Correct |
1 ms |
4956 KB |
Output is correct |
24 |
Correct |
1 ms |
4956 KB |
Output is correct |
25 |
Correct |
3 ms |
5212 KB |
Output is correct |
26 |
Correct |
2 ms |
5468 KB |
Output is correct |
27 |
Correct |
2 ms |
5468 KB |
Output is correct |
28 |
Correct |
2 ms |
5468 KB |
Output is correct |
29 |
Correct |
2 ms |
5468 KB |
Output is correct |
30 |
Correct |
2 ms |
5464 KB |
Output is correct |
31 |
Correct |
2 ms |
5476 KB |
Output is correct |
32 |
Correct |
2 ms |
5468 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
4952 KB |
Output is correct |
2 |
Correct |
1 ms |
4956 KB |
Output is correct |
3 |
Correct |
1 ms |
4956 KB |
Output is correct |
4 |
Correct |
1 ms |
4956 KB |
Output is correct |
5 |
Correct |
1 ms |
4964 KB |
Output is correct |
6 |
Correct |
1 ms |
4956 KB |
Output is correct |
7 |
Correct |
1 ms |
4956 KB |
Output is correct |
8 |
Correct |
1 ms |
4956 KB |
Output is correct |
9 |
Correct |
2 ms |
4956 KB |
Output is correct |
10 |
Correct |
2 ms |
4956 KB |
Output is correct |
11 |
Correct |
1 ms |
4956 KB |
Output is correct |
12 |
Correct |
1 ms |
4964 KB |
Output is correct |
13 |
Correct |
1 ms |
4956 KB |
Output is correct |
14 |
Correct |
1 ms |
4956 KB |
Output is correct |
15 |
Correct |
1 ms |
4956 KB |
Output is correct |
16 |
Correct |
1 ms |
4956 KB |
Output is correct |
17 |
Correct |
1 ms |
4956 KB |
Output is correct |
18 |
Correct |
1 ms |
4956 KB |
Output is correct |
19 |
Correct |
1 ms |
4956 KB |
Output is correct |
20 |
Correct |
1 ms |
4956 KB |
Output is correct |
21 |
Correct |
1 ms |
4956 KB |
Output is correct |
22 |
Correct |
1 ms |
4956 KB |
Output is correct |
23 |
Correct |
2 ms |
4952 KB |
Output is correct |
24 |
Correct |
1 ms |
4956 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
4952 KB |
Output is correct |
2 |
Correct |
1 ms |
4956 KB |
Output is correct |
3 |
Correct |
1 ms |
4956 KB |
Output is correct |
4 |
Correct |
1 ms |
4956 KB |
Output is correct |
5 |
Correct |
1 ms |
4964 KB |
Output is correct |
6 |
Correct |
1 ms |
4956 KB |
Output is correct |
7 |
Correct |
1 ms |
4956 KB |
Output is correct |
8 |
Correct |
1 ms |
4956 KB |
Output is correct |
9 |
Correct |
1 ms |
4956 KB |
Output is correct |
10 |
Correct |
1 ms |
4956 KB |
Output is correct |
11 |
Correct |
1 ms |
4956 KB |
Output is correct |
12 |
Correct |
1 ms |
4956 KB |
Output is correct |
13 |
Correct |
2 ms |
4956 KB |
Output is correct |
14 |
Correct |
1 ms |
4956 KB |
Output is correct |
15 |
Correct |
1 ms |
4956 KB |
Output is correct |
16 |
Correct |
1 ms |
4956 KB |
Output is correct |
17 |
Correct |
1 ms |
4956 KB |
Output is correct |
18 |
Correct |
1 ms |
4956 KB |
Output is correct |
19 |
Correct |
1 ms |
4956 KB |
Output is correct |
20 |
Correct |
1 ms |
4956 KB |
Output is correct |
21 |
Correct |
2 ms |
4956 KB |
Output is correct |
22 |
Correct |
2 ms |
4956 KB |
Output is correct |
23 |
Correct |
1 ms |
4956 KB |
Output is correct |
24 |
Correct |
1 ms |
4964 KB |
Output is correct |
25 |
Correct |
1 ms |
4956 KB |
Output is correct |
26 |
Correct |
1 ms |
4956 KB |
Output is correct |
27 |
Correct |
1 ms |
4956 KB |
Output is correct |
28 |
Correct |
1 ms |
4956 KB |
Output is correct |
29 |
Correct |
1 ms |
4956 KB |
Output is correct |
30 |
Correct |
1 ms |
4956 KB |
Output is correct |
31 |
Correct |
1 ms |
4956 KB |
Output is correct |
32 |
Correct |
1 ms |
4956 KB |
Output is correct |
33 |
Correct |
1 ms |
4956 KB |
Output is correct |
34 |
Correct |
1 ms |
4956 KB |
Output is correct |
35 |
Correct |
2 ms |
4952 KB |
Output is correct |
36 |
Correct |
1 ms |
4956 KB |
Output is correct |
37 |
Correct |
2 ms |
4956 KB |
Output is correct |
38 |
Correct |
1 ms |
4956 KB |
Output is correct |
39 |
Correct |
1 ms |
4952 KB |
Output is correct |
40 |
Correct |
1 ms |
4956 KB |
Output is correct |
41 |
Correct |
1 ms |
5136 KB |
Output is correct |
42 |
Correct |
1 ms |
4956 KB |
Output is correct |
43 |
Correct |
1 ms |
4956 KB |
Output is correct |
44 |
Correct |
1 ms |
4952 KB |
Output is correct |
45 |
Correct |
1 ms |
4964 KB |
Output is correct |
46 |
Correct |
1 ms |
4956 KB |
Output is correct |
47 |
Correct |
1 ms |
4956 KB |
Output is correct |
48 |
Correct |
1 ms |
4956 KB |
Output is correct |
49 |
Correct |
1 ms |
5140 KB |
Output is correct |
50 |
Correct |
2 ms |
4956 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
4952 KB |
Output is correct |
2 |
Correct |
1 ms |
4956 KB |
Output is correct |
3 |
Correct |
1 ms |
4956 KB |
Output is correct |
4 |
Correct |
1 ms |
4956 KB |
Output is correct |
5 |
Correct |
1 ms |
4964 KB |
Output is correct |
6 |
Correct |
1 ms |
4956 KB |
Output is correct |
7 |
Correct |
1 ms |
4956 KB |
Output is correct |
8 |
Correct |
1 ms |
4956 KB |
Output is correct |
9 |
Correct |
1 ms |
4956 KB |
Output is correct |
10 |
Correct |
1 ms |
4956 KB |
Output is correct |
11 |
Correct |
1 ms |
4956 KB |
Output is correct |
12 |
Correct |
1 ms |
4956 KB |
Output is correct |
13 |
Correct |
2 ms |
4956 KB |
Output is correct |
14 |
Correct |
1 ms |
4956 KB |
Output is correct |
15 |
Correct |
1 ms |
4956 KB |
Output is correct |
16 |
Correct |
1 ms |
4956 KB |
Output is correct |
17 |
Correct |
1 ms |
4956 KB |
Output is correct |
18 |
Correct |
1 ms |
4956 KB |
Output is correct |
19 |
Correct |
1 ms |
5136 KB |
Output is correct |
20 |
Correct |
1 ms |
4952 KB |
Output is correct |
21 |
Correct |
1 ms |
4956 KB |
Output is correct |
22 |
Correct |
1 ms |
5140 KB |
Output is correct |
23 |
Correct |
1 ms |
4956 KB |
Output is correct |
24 |
Correct |
1 ms |
4956 KB |
Output is correct |
25 |
Correct |
1 ms |
4956 KB |
Output is correct |
26 |
Correct |
1 ms |
4956 KB |
Output is correct |
27 |
Correct |
1 ms |
4956 KB |
Output is correct |
28 |
Correct |
2 ms |
4956 KB |
Output is correct |
29 |
Correct |
2 ms |
4956 KB |
Output is correct |
30 |
Correct |
1 ms |
4956 KB |
Output is correct |
31 |
Correct |
1 ms |
4964 KB |
Output is correct |
32 |
Correct |
1 ms |
4956 KB |
Output is correct |
33 |
Correct |
1 ms |
4956 KB |
Output is correct |
34 |
Correct |
1 ms |
4956 KB |
Output is correct |
35 |
Correct |
1 ms |
4956 KB |
Output is correct |
36 |
Correct |
1 ms |
4956 KB |
Output is correct |
37 |
Correct |
1 ms |
4956 KB |
Output is correct |
38 |
Correct |
1 ms |
4956 KB |
Output is correct |
39 |
Correct |
1 ms |
4956 KB |
Output is correct |
40 |
Correct |
1 ms |
4956 KB |
Output is correct |
41 |
Correct |
1 ms |
4956 KB |
Output is correct |
42 |
Correct |
2 ms |
4952 KB |
Output is correct |
43 |
Correct |
1 ms |
4956 KB |
Output is correct |
44 |
Correct |
2 ms |
4956 KB |
Output is correct |
45 |
Correct |
1 ms |
4956 KB |
Output is correct |
46 |
Correct |
1 ms |
4952 KB |
Output is correct |
47 |
Correct |
1 ms |
4956 KB |
Output is correct |
48 |
Correct |
1 ms |
5136 KB |
Output is correct |
49 |
Correct |
1 ms |
4956 KB |
Output is correct |
50 |
Correct |
1 ms |
4956 KB |
Output is correct |
51 |
Correct |
1 ms |
4952 KB |
Output is correct |
52 |
Correct |
1 ms |
4964 KB |
Output is correct |
53 |
Correct |
1 ms |
4956 KB |
Output is correct |
54 |
Correct |
1 ms |
4956 KB |
Output is correct |
55 |
Correct |
1 ms |
4956 KB |
Output is correct |
56 |
Correct |
1 ms |
5140 KB |
Output is correct |
57 |
Correct |
2 ms |
4956 KB |
Output is correct |
58 |
Correct |
2 ms |
4956 KB |
Output is correct |
59 |
Correct |
1 ms |
5136 KB |
Output is correct |
60 |
Correct |
1 ms |
4956 KB |
Output is correct |
61 |
Correct |
1 ms |
4956 KB |
Output is correct |
62 |
Correct |
2 ms |
4952 KB |
Output is correct |
63 |
Correct |
2 ms |
4956 KB |
Output is correct |
64 |
Correct |
1 ms |
4964 KB |
Output is correct |
65 |
Correct |
1 ms |
5204 KB |
Output is correct |
66 |
Correct |
1 ms |
4956 KB |
Output is correct |
67 |
Correct |
2 ms |
5128 KB |
Output is correct |
68 |
Correct |
1 ms |
4956 KB |
Output is correct |
69 |
Correct |
1 ms |
4956 KB |
Output is correct |
70 |
Correct |
1 ms |
4956 KB |
Output is correct |
71 |
Correct |
1 ms |
4956 KB |
Output is correct |
72 |
Correct |
2 ms |
4956 KB |
Output is correct |
73 |
Correct |
2 ms |
4956 KB |
Output is correct |
74 |
Correct |
2 ms |
4956 KB |
Output is correct |
75 |
Correct |
1 ms |
4956 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
4952 KB |
Output is correct |
2 |
Correct |
1 ms |
4956 KB |
Output is correct |
3 |
Correct |
1 ms |
4956 KB |
Output is correct |
4 |
Correct |
1 ms |
4956 KB |
Output is correct |
5 |
Correct |
1 ms |
4964 KB |
Output is correct |
6 |
Correct |
1 ms |
4956 KB |
Output is correct |
7 |
Correct |
1 ms |
4956 KB |
Output is correct |
8 |
Correct |
1 ms |
4956 KB |
Output is correct |
9 |
Correct |
1 ms |
4956 KB |
Output is correct |
10 |
Correct |
1 ms |
4956 KB |
Output is correct |
11 |
Correct |
1 ms |
4956 KB |
Output is correct |
12 |
Correct |
1 ms |
4956 KB |
Output is correct |
13 |
Correct |
2 ms |
4956 KB |
Output is correct |
14 |
Correct |
1 ms |
4956 KB |
Output is correct |
15 |
Correct |
1 ms |
4956 KB |
Output is correct |
16 |
Correct |
1 ms |
4956 KB |
Output is correct |
17 |
Correct |
1 ms |
4956 KB |
Output is correct |
18 |
Correct |
1 ms |
4956 KB |
Output is correct |
19 |
Correct |
1 ms |
5136 KB |
Output is correct |
20 |
Correct |
1 ms |
4952 KB |
Output is correct |
21 |
Correct |
1 ms |
4956 KB |
Output is correct |
22 |
Correct |
1 ms |
5140 KB |
Output is correct |
23 |
Correct |
1 ms |
4956 KB |
Output is correct |
24 |
Correct |
1 ms |
4956 KB |
Output is correct |
25 |
Correct |
1 ms |
4956 KB |
Output is correct |
26 |
Correct |
3 ms |
5212 KB |
Output is correct |
27 |
Correct |
2 ms |
5468 KB |
Output is correct |
28 |
Correct |
2 ms |
5468 KB |
Output is correct |
29 |
Correct |
2 ms |
5468 KB |
Output is correct |
30 |
Correct |
2 ms |
5468 KB |
Output is correct |
31 |
Correct |
2 ms |
5464 KB |
Output is correct |
32 |
Correct |
2 ms |
5476 KB |
Output is correct |
33 |
Correct |
2 ms |
5468 KB |
Output is correct |
34 |
Correct |
1 ms |
4956 KB |
Output is correct |
35 |
Correct |
1 ms |
4956 KB |
Output is correct |
36 |
Correct |
2 ms |
4956 KB |
Output is correct |
37 |
Correct |
2 ms |
4956 KB |
Output is correct |
38 |
Correct |
1 ms |
4956 KB |
Output is correct |
39 |
Correct |
1 ms |
4964 KB |
Output is correct |
40 |
Correct |
1 ms |
4956 KB |
Output is correct |
41 |
Correct |
1 ms |
4956 KB |
Output is correct |
42 |
Correct |
1 ms |
4956 KB |
Output is correct |
43 |
Correct |
1 ms |
4956 KB |
Output is correct |
44 |
Correct |
1 ms |
4956 KB |
Output is correct |
45 |
Correct |
1 ms |
4956 KB |
Output is correct |
46 |
Correct |
1 ms |
4956 KB |
Output is correct |
47 |
Correct |
1 ms |
4956 KB |
Output is correct |
48 |
Correct |
1 ms |
4956 KB |
Output is correct |
49 |
Correct |
1 ms |
4956 KB |
Output is correct |
50 |
Correct |
2 ms |
4952 KB |
Output is correct |
51 |
Correct |
1 ms |
4956 KB |
Output is correct |
52 |
Correct |
2 ms |
4956 KB |
Output is correct |
53 |
Correct |
1 ms |
4956 KB |
Output is correct |
54 |
Correct |
1 ms |
4952 KB |
Output is correct |
55 |
Correct |
1 ms |
4956 KB |
Output is correct |
56 |
Correct |
1 ms |
5136 KB |
Output is correct |
57 |
Correct |
1 ms |
4956 KB |
Output is correct |
58 |
Correct |
1 ms |
4956 KB |
Output is correct |
59 |
Correct |
1 ms |
4952 KB |
Output is correct |
60 |
Correct |
1 ms |
4964 KB |
Output is correct |
61 |
Correct |
1 ms |
4956 KB |
Output is correct |
62 |
Correct |
1 ms |
4956 KB |
Output is correct |
63 |
Correct |
1 ms |
4956 KB |
Output is correct |
64 |
Correct |
1 ms |
5140 KB |
Output is correct |
65 |
Correct |
2 ms |
4956 KB |
Output is correct |
66 |
Correct |
2 ms |
4956 KB |
Output is correct |
67 |
Correct |
1 ms |
5136 KB |
Output is correct |
68 |
Correct |
1 ms |
4956 KB |
Output is correct |
69 |
Correct |
1 ms |
4956 KB |
Output is correct |
70 |
Correct |
2 ms |
4952 KB |
Output is correct |
71 |
Correct |
2 ms |
4956 KB |
Output is correct |
72 |
Correct |
1 ms |
4964 KB |
Output is correct |
73 |
Correct |
1 ms |
5204 KB |
Output is correct |
74 |
Correct |
1 ms |
4956 KB |
Output is correct |
75 |
Correct |
2 ms |
5128 KB |
Output is correct |
76 |
Correct |
1 ms |
4956 KB |
Output is correct |
77 |
Correct |
1 ms |
4956 KB |
Output is correct |
78 |
Correct |
1 ms |
4956 KB |
Output is correct |
79 |
Correct |
1 ms |
4956 KB |
Output is correct |
80 |
Correct |
2 ms |
4956 KB |
Output is correct |
81 |
Correct |
2 ms |
4956 KB |
Output is correct |
82 |
Correct |
2 ms |
4956 KB |
Output is correct |
83 |
Correct |
1 ms |
4956 KB |
Output is correct |
84 |
Correct |
2 ms |
5212 KB |
Output is correct |
85 |
Correct |
2 ms |
5212 KB |
Output is correct |
86 |
Correct |
2 ms |
5212 KB |
Output is correct |
87 |
Correct |
2 ms |
5212 KB |
Output is correct |
88 |
Correct |
2 ms |
5208 KB |
Output is correct |
89 |
Correct |
3 ms |
5468 KB |
Output is correct |
90 |
Correct |
3 ms |
5468 KB |
Output is correct |
91 |
Correct |
2 ms |
5468 KB |
Output is correct |
92 |
Correct |
2 ms |
5468 KB |
Output is correct |
93 |
Correct |
2 ms |
5468 KB |
Output is correct |
94 |
Correct |
2 ms |
5468 KB |
Output is correct |
95 |
Correct |
2 ms |
5468 KB |
Output is correct |
96 |
Correct |
2 ms |
5468 KB |
Output is correct |
97 |
Correct |
2 ms |
5468 KB |
Output is correct |
98 |
Correct |
2 ms |
5468 KB |
Output is correct |
99 |
Correct |
2 ms |
5468 KB |
Output is correct |
100 |
Correct |
2 ms |
5196 KB |
Output is correct |
101 |
Correct |
2 ms |
5212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
4952 KB |
Output is correct |
2 |
Correct |
1 ms |
4956 KB |
Output is correct |
3 |
Correct |
1 ms |
4956 KB |
Output is correct |
4 |
Correct |
1 ms |
4956 KB |
Output is correct |
5 |
Correct |
1 ms |
4964 KB |
Output is correct |
6 |
Correct |
1 ms |
4956 KB |
Output is correct |
7 |
Correct |
1 ms |
4956 KB |
Output is correct |
8 |
Correct |
1 ms |
4956 KB |
Output is correct |
9 |
Correct |
1 ms |
4956 KB |
Output is correct |
10 |
Correct |
1 ms |
4956 KB |
Output is correct |
11 |
Correct |
1 ms |
4956 KB |
Output is correct |
12 |
Correct |
1 ms |
4956 KB |
Output is correct |
13 |
Correct |
2 ms |
4956 KB |
Output is correct |
14 |
Correct |
1 ms |
4956 KB |
Output is correct |
15 |
Correct |
1 ms |
4956 KB |
Output is correct |
16 |
Correct |
1 ms |
4956 KB |
Output is correct |
17 |
Correct |
1 ms |
4956 KB |
Output is correct |
18 |
Correct |
1 ms |
4956 KB |
Output is correct |
19 |
Correct |
1 ms |
5136 KB |
Output is correct |
20 |
Correct |
1 ms |
4952 KB |
Output is correct |
21 |
Correct |
1 ms |
4956 KB |
Output is correct |
22 |
Correct |
1 ms |
5140 KB |
Output is correct |
23 |
Correct |
1 ms |
4956 KB |
Output is correct |
24 |
Correct |
1 ms |
4956 KB |
Output is correct |
25 |
Correct |
1 ms |
4956 KB |
Output is correct |
26 |
Correct |
3 ms |
5212 KB |
Output is correct |
27 |
Correct |
2 ms |
5468 KB |
Output is correct |
28 |
Correct |
2 ms |
5468 KB |
Output is correct |
29 |
Correct |
2 ms |
5468 KB |
Output is correct |
30 |
Correct |
2 ms |
5468 KB |
Output is correct |
31 |
Correct |
2 ms |
5464 KB |
Output is correct |
32 |
Correct |
2 ms |
5476 KB |
Output is correct |
33 |
Correct |
2 ms |
5468 KB |
Output is correct |
34 |
Correct |
1 ms |
4956 KB |
Output is correct |
35 |
Correct |
1 ms |
4956 KB |
Output is correct |
36 |
Correct |
2 ms |
4956 KB |
Output is correct |
37 |
Correct |
2 ms |
4956 KB |
Output is correct |
38 |
Correct |
1 ms |
4956 KB |
Output is correct |
39 |
Correct |
1 ms |
4964 KB |
Output is correct |
40 |
Correct |
1 ms |
4956 KB |
Output is correct |
41 |
Correct |
1 ms |
4956 KB |
Output is correct |
42 |
Correct |
1 ms |
4956 KB |
Output is correct |
43 |
Correct |
1 ms |
4956 KB |
Output is correct |
44 |
Correct |
1 ms |
4956 KB |
Output is correct |
45 |
Correct |
1 ms |
4956 KB |
Output is correct |
46 |
Correct |
1 ms |
4956 KB |
Output is correct |
47 |
Correct |
1 ms |
4956 KB |
Output is correct |
48 |
Correct |
1 ms |
4956 KB |
Output is correct |
49 |
Correct |
1 ms |
4956 KB |
Output is correct |
50 |
Correct |
2 ms |
4952 KB |
Output is correct |
51 |
Correct |
1 ms |
4956 KB |
Output is correct |
52 |
Correct |
2 ms |
4956 KB |
Output is correct |
53 |
Correct |
1 ms |
4956 KB |
Output is correct |
54 |
Correct |
1 ms |
4952 KB |
Output is correct |
55 |
Correct |
1 ms |
4956 KB |
Output is correct |
56 |
Correct |
1 ms |
5136 KB |
Output is correct |
57 |
Correct |
1 ms |
4956 KB |
Output is correct |
58 |
Correct |
1 ms |
4956 KB |
Output is correct |
59 |
Correct |
1 ms |
4952 KB |
Output is correct |
60 |
Correct |
1 ms |
4964 KB |
Output is correct |
61 |
Correct |
1 ms |
4956 KB |
Output is correct |
62 |
Correct |
1 ms |
4956 KB |
Output is correct |
63 |
Correct |
1 ms |
4956 KB |
Output is correct |
64 |
Correct |
1 ms |
5140 KB |
Output is correct |
65 |
Correct |
2 ms |
4956 KB |
Output is correct |
66 |
Correct |
2 ms |
4956 KB |
Output is correct |
67 |
Correct |
1 ms |
5136 KB |
Output is correct |
68 |
Correct |
1 ms |
4956 KB |
Output is correct |
69 |
Correct |
1 ms |
4956 KB |
Output is correct |
70 |
Correct |
2 ms |
4952 KB |
Output is correct |
71 |
Correct |
2 ms |
4956 KB |
Output is correct |
72 |
Correct |
1 ms |
4964 KB |
Output is correct |
73 |
Correct |
1 ms |
5204 KB |
Output is correct |
74 |
Correct |
1 ms |
4956 KB |
Output is correct |
75 |
Correct |
2 ms |
5128 KB |
Output is correct |
76 |
Correct |
1 ms |
4956 KB |
Output is correct |
77 |
Correct |
1 ms |
4956 KB |
Output is correct |
78 |
Correct |
1 ms |
4956 KB |
Output is correct |
79 |
Correct |
1 ms |
4956 KB |
Output is correct |
80 |
Correct |
2 ms |
4956 KB |
Output is correct |
81 |
Correct |
2 ms |
4956 KB |
Output is correct |
82 |
Correct |
2 ms |
4956 KB |
Output is correct |
83 |
Correct |
1 ms |
4956 KB |
Output is correct |
84 |
Correct |
2 ms |
5212 KB |
Output is correct |
85 |
Correct |
2 ms |
5212 KB |
Output is correct |
86 |
Correct |
2 ms |
5212 KB |
Output is correct |
87 |
Correct |
2 ms |
5212 KB |
Output is correct |
88 |
Correct |
2 ms |
5208 KB |
Output is correct |
89 |
Correct |
3 ms |
5468 KB |
Output is correct |
90 |
Correct |
3 ms |
5468 KB |
Output is correct |
91 |
Correct |
2 ms |
5468 KB |
Output is correct |
92 |
Correct |
2 ms |
5468 KB |
Output is correct |
93 |
Correct |
2 ms |
5468 KB |
Output is correct |
94 |
Correct |
2 ms |
5468 KB |
Output is correct |
95 |
Correct |
2 ms |
5468 KB |
Output is correct |
96 |
Correct |
2 ms |
5468 KB |
Output is correct |
97 |
Correct |
2 ms |
5468 KB |
Output is correct |
98 |
Correct |
2 ms |
5468 KB |
Output is correct |
99 |
Correct |
2 ms |
5468 KB |
Output is correct |
100 |
Correct |
2 ms |
5196 KB |
Output is correct |
101 |
Correct |
2 ms |
5212 KB |
Output is correct |
102 |
Correct |
52 ms |
10032 KB |
Output is correct |
103 |
Correct |
59 ms |
9716 KB |
Output is correct |
104 |
Correct |
127 ms |
33212 KB |
Output is correct |
105 |
Correct |
61 ms |
11000 KB |
Output is correct |
106 |
Correct |
65 ms |
10836 KB |
Output is correct |
107 |
Correct |
52 ms |
29508 KB |
Output is correct |
108 |
Correct |
53 ms |
30268 KB |
Output is correct |
109 |
Correct |
61 ms |
31552 KB |
Output is correct |
110 |
Correct |
116 ms |
31620 KB |
Output is correct |
111 |
Correct |
73 ms |
32412 KB |
Output is correct |
112 |
Correct |
113 ms |
30812 KB |
Output is correct |
113 |
Correct |
106 ms |
30600 KB |
Output is correct |
114 |
Correct |
99 ms |
32000 KB |
Output is correct |
115 |
Correct |
79 ms |
31824 KB |
Output is correct |
116 |
Correct |
105 ms |
32192 KB |
Output is correct |
117 |
Correct |
111 ms |
31424 KB |
Output is correct |
118 |
Correct |
104 ms |
31432 KB |
Output is correct |
119 |
Correct |
69 ms |
13448 KB |
Output is correct |
120 |
Correct |
54 ms |
9552 KB |
Output is correct |