#include "closing.h"
//#include "grader.cpp"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, x, y; ll k;
const int MAXN = 2e5 + 25;
vector <pair <ll, ll>> adj[MAXN];
ll dist[MAXN][2], f[MAXN], g[MAXN];
vector <int> cur, path;
void add_edge (int x, int y, int z) {
adj[x].push_back({y, z});
adj[y].push_back({x, z});
}
void dfs (int pos, int par, ll d, int c) {
dist[pos][c] = d;
for (auto j : adj[pos]) {
if (j.first != par) {
dfs(j.first, pos, d + j.second, c);
}
}
}
bool dfs2 (int pos, int par, int c) {
cur.push_back(pos);
if (pos == c) {
path = cur;
return 1;
}
for (auto j : adj[pos]) {
if (j.first != par) {
if (dfs2(j.first, pos, c)) {
return 1;
}
}
}
cur.pop_back();
return 0;
}
int solve1 () {
vector <ll> zz;
for (int i = 1; i <= n; i++) {
zz.push_back(f[i]);
zz.push_back(g[i]);
}
sort(zz.begin(), zz.end());
for (int i = 1; i < 2 * n; i++) zz[i] += zz[i - 1];
int ans1 = upper_bound(zz.begin(), zz.end(), k) - zz.begin();
return ans1;
}
struct OfflineBit {
vector <ll> tree, comp;
void insert (ll x) {
comp.push_back(x);
}
void build () {
sort(comp.begin(), comp.end());
comp.resize(unique(comp.begin(), comp.end()) - comp.begin());
tree.resize(comp.size());
tree.insert(tree.begin(), 0);
}
int find (ll x) {
return upper_bound(comp.begin(), comp.end(), x) - comp.begin();
}
inline int lsb (int x) {
return x & (-x);
}
void add (ll x, ll y) {
x = find(x);
assert(x >= 0 && x < (int)(tree.size()));
for (; x < int(tree.size()); x += lsb(x)) {
tree[x] += y;
}
}
ll get (ll x) {
x = find(x);
assert(x >= 0 && x < (int)(tree.size()));
ll ret = 0;
for (; x > 0; x -= lsb(x)) {
ret += tree[x];
}
return ret;
}
};
int solve2 () {
ll u = k;
for (auto j : path) {
u -= f[j];
f[j] = g[j] - f[j];
g[j] = 1e18;
}
if (u < 0) {
return -1;
}
vector <pair <ll, ll>> a;
for (int i = 1; i <= n; i++) {
a.push_back({g[i], f[i]});
}
sort(a.begin(), a.end());
OfflineBit c1, c2;
ll cur_sum = 0;
c1.insert(0); c2.insert(0);
for (auto i : a) {
cur_sum += i.second;
c1.insert(i.second); c1.insert(i.first - i.second);
c2.insert(i.second); c2.insert(i.first - i.second);
c1.insert(cur_sum); c2.insert(cur_sum);
}
c1.build(); c2.build();
cur_sum = 0;
for (auto i : a) {
c1.add(i.second, 1); c2.add(i.second, i.second);
}
int ret = -1e9;
auto val = [&] (int cnt) -> int {
if (cur_sum > u) return -1e9;
ll l = 0, r = 1e18, ans = -1;
while (l <= r) {
ll mid = (l + r) / 2;
if (c2.get(mid) <= u - cur_sum) {
l = mid + 1; ans = mid;
} else {
r = mid - 1;
}
}
if (ans == -1) return -1e9;
ll v = c1.get(ans + 1) - c1.get(ans);
ll r2 = (u - cur_sum - c2.get(ans)) / (ans + 1);
r2 = min(r2, v);
return r2 + c1.get(ans) + cnt;
};
ret = val(0);
int ee = 0;
for (auto i : a) {
ee++; cur_sum += i.second;
c1.add(i.second, -1); c2.add(i.second, -i.second);
c1.add(i.first - i.second, 1); c2.add(i.first - i.second, i.first - i.second);
ret = max(ret, val(ee));
}
return ret + (int)path.size();
}
int max_score (int N2, int X2, int Y2, ll K2, vector <int> u, vector <int> v, vector <int> w) {
n = N2; x = X2; y = Y2; k = K2;
x++; y++;
cur.clear(); path.clear();
for (int i = 1; i <= n; i++) {
adj[i].clear();
}
for (int i = 0; i + 1 < n; i++) {
add_edge(u[i] + 1, v[i] + 1, w[i]);
}
dfs(x, -1, 0, 0);
dfs(y, -1, 0, 1);
dfs2(x, -1, y);
for (int i = 1; i <= n; i++) {
f[i] = min(dist[i][0], dist[i][1]);
g[i] = max(dist[i][0], dist[i][1]);
}
int ret1 = solve1(), ret2 = solve2();
return max(ret1, ret2);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
4956 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
115 ms |
39988 KB |
Output is correct |
2 |
Correct |
120 ms |
46812 KB |
Output is correct |
3 |
Correct |
57 ms |
10396 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
5144 KB |
Output is correct |
2 |
Correct |
3 ms |
4956 KB |
Output is correct |
3 |
Correct |
2 ms |
4952 KB |
Output is correct |
4 |
Correct |
3 ms |
4956 KB |
Output is correct |
5 |
Correct |
2 ms |
4956 KB |
Output is correct |
6 |
Correct |
2 ms |
4956 KB |
Output is correct |
7 |
Correct |
2 ms |
4956 KB |
Output is correct |
8 |
Correct |
2 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 |
2 ms |
4956 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
5144 KB |
Output is correct |
2 |
Correct |
3 ms |
4956 KB |
Output is correct |
3 |
Correct |
2 ms |
4952 KB |
Output is correct |
4 |
Correct |
3 ms |
4956 KB |
Output is correct |
5 |
Correct |
2 ms |
4956 KB |
Output is correct |
6 |
Correct |
2 ms |
4956 KB |
Output is correct |
7 |
Correct |
2 ms |
4956 KB |
Output is correct |
8 |
Correct |
2 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 |
2 ms |
4956 KB |
Output is correct |
12 |
Correct |
2 ms |
4952 KB |
Output is correct |
13 |
Correct |
2 ms |
4956 KB |
Output is correct |
14 |
Correct |
2 ms |
4956 KB |
Output is correct |
15 |
Correct |
2 ms |
4956 KB |
Output is correct |
16 |
Correct |
2 ms |
4956 KB |
Output is correct |
17 |
Correct |
2 ms |
4956 KB |
Output is correct |
18 |
Correct |
2 ms |
4956 KB |
Output is correct |
19 |
Correct |
3 ms |
5212 KB |
Output is correct |
20 |
Correct |
2 ms |
5212 KB |
Output is correct |
21 |
Correct |
4 ms |
5212 KB |
Output is correct |
22 |
Correct |
2 ms |
5212 KB |
Output is correct |
23 |
Correct |
2 ms |
5212 KB |
Output is correct |
24 |
Correct |
2 ms |
5044 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
5144 KB |
Output is correct |
2 |
Correct |
3 ms |
4956 KB |
Output is correct |
3 |
Correct |
2 ms |
4952 KB |
Output is correct |
4 |
Correct |
3 ms |
4956 KB |
Output is correct |
5 |
Correct |
2 ms |
4956 KB |
Output is correct |
6 |
Correct |
2 ms |
4956 KB |
Output is correct |
7 |
Correct |
2 ms |
4956 KB |
Output is correct |
8 |
Correct |
2 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 |
2 ms |
4956 KB |
Output is correct |
12 |
Correct |
2 ms |
4952 KB |
Output is correct |
13 |
Correct |
2 ms |
4956 KB |
Output is correct |
14 |
Correct |
2 ms |
4956 KB |
Output is correct |
15 |
Correct |
2 ms |
4956 KB |
Output is correct |
16 |
Correct |
2 ms |
4956 KB |
Output is correct |
17 |
Correct |
2 ms |
4956 KB |
Output is correct |
18 |
Correct |
2 ms |
4956 KB |
Output is correct |
19 |
Correct |
3 ms |
5212 KB |
Output is correct |
20 |
Correct |
2 ms |
5212 KB |
Output is correct |
21 |
Correct |
4 ms |
5212 KB |
Output is correct |
22 |
Correct |
2 ms |
5212 KB |
Output is correct |
23 |
Correct |
2 ms |
5212 KB |
Output is correct |
24 |
Correct |
2 ms |
5044 KB |
Output is correct |
25 |
Correct |
5 ms |
5212 KB |
Output is correct |
26 |
Correct |
7 ms |
5976 KB |
Output is correct |
27 |
Correct |
5 ms |
5980 KB |
Output is correct |
28 |
Correct |
8 ms |
6200 KB |
Output is correct |
29 |
Correct |
9 ms |
6124 KB |
Output is correct |
30 |
Correct |
3 ms |
5724 KB |
Output is correct |
31 |
Correct |
3 ms |
5724 KB |
Output is correct |
32 |
Correct |
3 ms |
5720 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
4956 KB |
Output is correct |
2 |
Correct |
2 ms |
5144 KB |
Output is correct |
3 |
Correct |
3 ms |
4956 KB |
Output is correct |
4 |
Correct |
2 ms |
4952 KB |
Output is correct |
5 |
Correct |
3 ms |
4956 KB |
Output is correct |
6 |
Correct |
2 ms |
4956 KB |
Output is correct |
7 |
Correct |
3 ms |
4956 KB |
Output is correct |
8 |
Correct |
3 ms |
4956 KB |
Output is correct |
9 |
Correct |
2 ms |
4956 KB |
Output is correct |
10 |
Correct |
3 ms |
4952 KB |
Output is correct |
11 |
Correct |
2 ms |
4956 KB |
Output is correct |
12 |
Correct |
2 ms |
4956 KB |
Output is correct |
13 |
Correct |
2 ms |
4956 KB |
Output is correct |
14 |
Correct |
2 ms |
4956 KB |
Output is correct |
15 |
Correct |
2 ms |
4956 KB |
Output is correct |
16 |
Correct |
2 ms |
4956 KB |
Output is correct |
17 |
Correct |
3 ms |
4956 KB |
Output is correct |
18 |
Correct |
2 ms |
4952 KB |
Output is correct |
19 |
Correct |
3 ms |
4956 KB |
Output is correct |
20 |
Correct |
2 ms |
5120 KB |
Output is correct |
21 |
Correct |
2 ms |
4956 KB |
Output is correct |
22 |
Correct |
2 ms |
5164 KB |
Output is correct |
23 |
Correct |
2 ms |
5148 KB |
Output is correct |
24 |
Correct |
2 ms |
4956 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
4956 KB |
Output is correct |
2 |
Correct |
2 ms |
5144 KB |
Output is correct |
3 |
Correct |
3 ms |
4956 KB |
Output is correct |
4 |
Correct |
2 ms |
4952 KB |
Output is correct |
5 |
Correct |
3 ms |
4956 KB |
Output is correct |
6 |
Correct |
2 ms |
4956 KB |
Output is correct |
7 |
Correct |
2 ms |
4956 KB |
Output is correct |
8 |
Correct |
2 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 |
2 ms |
4956 KB |
Output is correct |
12 |
Correct |
2 ms |
4956 KB |
Output is correct |
13 |
Correct |
2 ms |
4952 KB |
Output is correct |
14 |
Correct |
2 ms |
4956 KB |
Output is correct |
15 |
Correct |
2 ms |
4956 KB |
Output is correct |
16 |
Correct |
2 ms |
4956 KB |
Output is correct |
17 |
Correct |
2 ms |
4956 KB |
Output is correct |
18 |
Correct |
2 ms |
4956 KB |
Output is correct |
19 |
Correct |
3 ms |
4956 KB |
Output is correct |
20 |
Correct |
3 ms |
4956 KB |
Output is correct |
21 |
Correct |
2 ms |
4956 KB |
Output is correct |
22 |
Correct |
3 ms |
4952 KB |
Output is correct |
23 |
Correct |
2 ms |
4956 KB |
Output is correct |
24 |
Correct |
2 ms |
4956 KB |
Output is correct |
25 |
Correct |
2 ms |
4956 KB |
Output is correct |
26 |
Correct |
2 ms |
4956 KB |
Output is correct |
27 |
Correct |
2 ms |
4956 KB |
Output is correct |
28 |
Correct |
2 ms |
4956 KB |
Output is correct |
29 |
Correct |
3 ms |
4956 KB |
Output is correct |
30 |
Correct |
2 ms |
4952 KB |
Output is correct |
31 |
Correct |
3 ms |
4956 KB |
Output is correct |
32 |
Correct |
2 ms |
5120 KB |
Output is correct |
33 |
Correct |
2 ms |
4956 KB |
Output is correct |
34 |
Correct |
2 ms |
5164 KB |
Output is correct |
35 |
Correct |
2 ms |
5148 KB |
Output is correct |
36 |
Correct |
2 ms |
4956 KB |
Output is correct |
37 |
Correct |
3 ms |
4952 KB |
Output is correct |
38 |
Correct |
2 ms |
4956 KB |
Output is correct |
39 |
Correct |
2 ms |
4956 KB |
Output is correct |
40 |
Correct |
2 ms |
4956 KB |
Output is correct |
41 |
Correct |
2 ms |
4956 KB |
Output is correct |
42 |
Correct |
2 ms |
4956 KB |
Output is correct |
43 |
Correct |
2 ms |
4956 KB |
Output is correct |
44 |
Correct |
2 ms |
5140 KB |
Output is correct |
45 |
Correct |
3 ms |
4956 KB |
Output is correct |
46 |
Correct |
3 ms |
4956 KB |
Output is correct |
47 |
Correct |
4 ms |
5212 KB |
Output is correct |
48 |
Correct |
2 ms |
4956 KB |
Output is correct |
49 |
Correct |
2 ms |
4956 KB |
Output is correct |
50 |
Correct |
2 ms |
4956 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
4956 KB |
Output is correct |
2 |
Correct |
2 ms |
5144 KB |
Output is correct |
3 |
Correct |
3 ms |
4956 KB |
Output is correct |
4 |
Correct |
2 ms |
4952 KB |
Output is correct |
5 |
Correct |
3 ms |
4956 KB |
Output is correct |
6 |
Correct |
2 ms |
4956 KB |
Output is correct |
7 |
Correct |
2 ms |
4956 KB |
Output is correct |
8 |
Correct |
2 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 |
2 ms |
4956 KB |
Output is correct |
12 |
Correct |
2 ms |
4956 KB |
Output is correct |
13 |
Correct |
2 ms |
4952 KB |
Output is correct |
14 |
Correct |
2 ms |
4956 KB |
Output is correct |
15 |
Correct |
2 ms |
4956 KB |
Output is correct |
16 |
Correct |
2 ms |
4956 KB |
Output is correct |
17 |
Correct |
2 ms |
4956 KB |
Output is correct |
18 |
Correct |
2 ms |
4956 KB |
Output is correct |
19 |
Correct |
2 ms |
4956 KB |
Output is correct |
20 |
Correct |
3 ms |
5212 KB |
Output is correct |
21 |
Correct |
2 ms |
5212 KB |
Output is correct |
22 |
Correct |
4 ms |
5212 KB |
Output is correct |
23 |
Correct |
2 ms |
5212 KB |
Output is correct |
24 |
Correct |
2 ms |
5212 KB |
Output is correct |
25 |
Correct |
2 ms |
5044 KB |
Output is correct |
26 |
Correct |
3 ms |
4956 KB |
Output is correct |
27 |
Correct |
3 ms |
4956 KB |
Output is correct |
28 |
Correct |
2 ms |
4956 KB |
Output is correct |
29 |
Correct |
3 ms |
4952 KB |
Output is correct |
30 |
Correct |
2 ms |
4956 KB |
Output is correct |
31 |
Correct |
2 ms |
4956 KB |
Output is correct |
32 |
Correct |
2 ms |
4956 KB |
Output is correct |
33 |
Correct |
2 ms |
4956 KB |
Output is correct |
34 |
Correct |
2 ms |
4956 KB |
Output is correct |
35 |
Correct |
2 ms |
4956 KB |
Output is correct |
36 |
Correct |
3 ms |
4956 KB |
Output is correct |
37 |
Correct |
2 ms |
4952 KB |
Output is correct |
38 |
Correct |
3 ms |
4956 KB |
Output is correct |
39 |
Correct |
2 ms |
5120 KB |
Output is correct |
40 |
Correct |
2 ms |
4956 KB |
Output is correct |
41 |
Correct |
2 ms |
5164 KB |
Output is correct |
42 |
Correct |
2 ms |
5148 KB |
Output is correct |
43 |
Correct |
2 ms |
4956 KB |
Output is correct |
44 |
Correct |
3 ms |
4952 KB |
Output is correct |
45 |
Correct |
2 ms |
4956 KB |
Output is correct |
46 |
Correct |
2 ms |
4956 KB |
Output is correct |
47 |
Correct |
2 ms |
4956 KB |
Output is correct |
48 |
Correct |
2 ms |
4956 KB |
Output is correct |
49 |
Correct |
2 ms |
4956 KB |
Output is correct |
50 |
Correct |
2 ms |
4956 KB |
Output is correct |
51 |
Correct |
2 ms |
5140 KB |
Output is correct |
52 |
Correct |
3 ms |
4956 KB |
Output is correct |
53 |
Correct |
3 ms |
4956 KB |
Output is correct |
54 |
Correct |
4 ms |
5212 KB |
Output is correct |
55 |
Correct |
2 ms |
4956 KB |
Output is correct |
56 |
Correct |
2 ms |
4956 KB |
Output is correct |
57 |
Correct |
2 ms |
4956 KB |
Output is correct |
58 |
Correct |
3 ms |
4956 KB |
Output is correct |
59 |
Correct |
3 ms |
5208 KB |
Output is correct |
60 |
Correct |
3 ms |
4960 KB |
Output is correct |
61 |
Correct |
3 ms |
5212 KB |
Output is correct |
62 |
Correct |
3 ms |
5212 KB |
Output is correct |
63 |
Correct |
3 ms |
5212 KB |
Output is correct |
64 |
Correct |
3 ms |
5212 KB |
Output is correct |
65 |
Correct |
4 ms |
5212 KB |
Output is correct |
66 |
Correct |
2 ms |
5212 KB |
Output is correct |
67 |
Correct |
2 ms |
5212 KB |
Output is correct |
68 |
Correct |
2 ms |
5208 KB |
Output is correct |
69 |
Correct |
3 ms |
5212 KB |
Output is correct |
70 |
Correct |
3 ms |
5212 KB |
Output is correct |
71 |
Correct |
3 ms |
5212 KB |
Output is correct |
72 |
Correct |
3 ms |
5212 KB |
Output is correct |
73 |
Correct |
3 ms |
5212 KB |
Output is correct |
74 |
Correct |
2 ms |
5212 KB |
Output is correct |
75 |
Correct |
3 ms |
4956 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
4956 KB |
Output is correct |
2 |
Correct |
2 ms |
5144 KB |
Output is correct |
3 |
Correct |
3 ms |
4956 KB |
Output is correct |
4 |
Correct |
2 ms |
4952 KB |
Output is correct |
5 |
Correct |
3 ms |
4956 KB |
Output is correct |
6 |
Correct |
2 ms |
4956 KB |
Output is correct |
7 |
Correct |
2 ms |
4956 KB |
Output is correct |
8 |
Correct |
2 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 |
2 ms |
4956 KB |
Output is correct |
12 |
Correct |
2 ms |
4956 KB |
Output is correct |
13 |
Correct |
2 ms |
4952 KB |
Output is correct |
14 |
Correct |
2 ms |
4956 KB |
Output is correct |
15 |
Correct |
2 ms |
4956 KB |
Output is correct |
16 |
Correct |
2 ms |
4956 KB |
Output is correct |
17 |
Correct |
2 ms |
4956 KB |
Output is correct |
18 |
Correct |
2 ms |
4956 KB |
Output is correct |
19 |
Correct |
2 ms |
4956 KB |
Output is correct |
20 |
Correct |
3 ms |
5212 KB |
Output is correct |
21 |
Correct |
2 ms |
5212 KB |
Output is correct |
22 |
Correct |
4 ms |
5212 KB |
Output is correct |
23 |
Correct |
2 ms |
5212 KB |
Output is correct |
24 |
Correct |
2 ms |
5212 KB |
Output is correct |
25 |
Correct |
2 ms |
5044 KB |
Output is correct |
26 |
Correct |
5 ms |
5212 KB |
Output is correct |
27 |
Correct |
7 ms |
5976 KB |
Output is correct |
28 |
Correct |
5 ms |
5980 KB |
Output is correct |
29 |
Correct |
8 ms |
6200 KB |
Output is correct |
30 |
Correct |
9 ms |
6124 KB |
Output is correct |
31 |
Correct |
3 ms |
5724 KB |
Output is correct |
32 |
Correct |
3 ms |
5724 KB |
Output is correct |
33 |
Correct |
3 ms |
5720 KB |
Output is correct |
34 |
Correct |
3 ms |
4956 KB |
Output is correct |
35 |
Correct |
3 ms |
4956 KB |
Output is correct |
36 |
Correct |
2 ms |
4956 KB |
Output is correct |
37 |
Correct |
3 ms |
4952 KB |
Output is correct |
38 |
Correct |
2 ms |
4956 KB |
Output is correct |
39 |
Correct |
2 ms |
4956 KB |
Output is correct |
40 |
Correct |
2 ms |
4956 KB |
Output is correct |
41 |
Correct |
2 ms |
4956 KB |
Output is correct |
42 |
Correct |
2 ms |
4956 KB |
Output is correct |
43 |
Correct |
2 ms |
4956 KB |
Output is correct |
44 |
Correct |
3 ms |
4956 KB |
Output is correct |
45 |
Correct |
2 ms |
4952 KB |
Output is correct |
46 |
Correct |
3 ms |
4956 KB |
Output is correct |
47 |
Correct |
2 ms |
5120 KB |
Output is correct |
48 |
Correct |
2 ms |
4956 KB |
Output is correct |
49 |
Correct |
2 ms |
5164 KB |
Output is correct |
50 |
Correct |
2 ms |
5148 KB |
Output is correct |
51 |
Correct |
2 ms |
4956 KB |
Output is correct |
52 |
Correct |
3 ms |
4952 KB |
Output is correct |
53 |
Correct |
2 ms |
4956 KB |
Output is correct |
54 |
Correct |
2 ms |
4956 KB |
Output is correct |
55 |
Correct |
2 ms |
4956 KB |
Output is correct |
56 |
Correct |
2 ms |
4956 KB |
Output is correct |
57 |
Correct |
2 ms |
4956 KB |
Output is correct |
58 |
Correct |
2 ms |
4956 KB |
Output is correct |
59 |
Correct |
2 ms |
5140 KB |
Output is correct |
60 |
Correct |
3 ms |
4956 KB |
Output is correct |
61 |
Correct |
3 ms |
4956 KB |
Output is correct |
62 |
Correct |
4 ms |
5212 KB |
Output is correct |
63 |
Correct |
2 ms |
4956 KB |
Output is correct |
64 |
Correct |
2 ms |
4956 KB |
Output is correct |
65 |
Correct |
2 ms |
4956 KB |
Output is correct |
66 |
Correct |
3 ms |
4956 KB |
Output is correct |
67 |
Correct |
3 ms |
5208 KB |
Output is correct |
68 |
Correct |
3 ms |
4960 KB |
Output is correct |
69 |
Correct |
3 ms |
5212 KB |
Output is correct |
70 |
Correct |
3 ms |
5212 KB |
Output is correct |
71 |
Correct |
3 ms |
5212 KB |
Output is correct |
72 |
Correct |
3 ms |
5212 KB |
Output is correct |
73 |
Correct |
4 ms |
5212 KB |
Output is correct |
74 |
Correct |
2 ms |
5212 KB |
Output is correct |
75 |
Correct |
2 ms |
5212 KB |
Output is correct |
76 |
Correct |
2 ms |
5208 KB |
Output is correct |
77 |
Correct |
3 ms |
5212 KB |
Output is correct |
78 |
Correct |
3 ms |
5212 KB |
Output is correct |
79 |
Correct |
3 ms |
5212 KB |
Output is correct |
80 |
Correct |
3 ms |
5212 KB |
Output is correct |
81 |
Correct |
3 ms |
5212 KB |
Output is correct |
82 |
Correct |
2 ms |
5212 KB |
Output is correct |
83 |
Correct |
3 ms |
4956 KB |
Output is correct |
84 |
Correct |
5 ms |
5212 KB |
Output is correct |
85 |
Correct |
5 ms |
5212 KB |
Output is correct |
86 |
Correct |
7 ms |
5212 KB |
Output is correct |
87 |
Correct |
5 ms |
5212 KB |
Output is correct |
88 |
Correct |
6 ms |
5212 KB |
Output is correct |
89 |
Correct |
8 ms |
5948 KB |
Output is correct |
90 |
Correct |
8 ms |
5680 KB |
Output is correct |
91 |
Correct |
5 ms |
5948 KB |
Output is correct |
92 |
Correct |
5 ms |
5720 KB |
Output is correct |
93 |
Correct |
4 ms |
5464 KB |
Output is correct |
94 |
Correct |
4 ms |
5924 KB |
Output is correct |
95 |
Correct |
4 ms |
5980 KB |
Output is correct |
96 |
Correct |
3 ms |
5724 KB |
Output is correct |
97 |
Correct |
8 ms |
5980 KB |
Output is correct |
98 |
Correct |
5 ms |
5724 KB |
Output is correct |
99 |
Correct |
7 ms |
5980 KB |
Output is correct |
100 |
Correct |
4 ms |
5468 KB |
Output is correct |
101 |
Correct |
6 ms |
5156 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
4956 KB |
Output is correct |
2 |
Correct |
2 ms |
5144 KB |
Output is correct |
3 |
Correct |
3 ms |
4956 KB |
Output is correct |
4 |
Correct |
2 ms |
4952 KB |
Output is correct |
5 |
Correct |
3 ms |
4956 KB |
Output is correct |
6 |
Correct |
2 ms |
4956 KB |
Output is correct |
7 |
Correct |
2 ms |
4956 KB |
Output is correct |
8 |
Correct |
2 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 |
2 ms |
4956 KB |
Output is correct |
12 |
Correct |
2 ms |
4956 KB |
Output is correct |
13 |
Correct |
2 ms |
4952 KB |
Output is correct |
14 |
Correct |
2 ms |
4956 KB |
Output is correct |
15 |
Correct |
2 ms |
4956 KB |
Output is correct |
16 |
Correct |
2 ms |
4956 KB |
Output is correct |
17 |
Correct |
2 ms |
4956 KB |
Output is correct |
18 |
Correct |
2 ms |
4956 KB |
Output is correct |
19 |
Correct |
2 ms |
4956 KB |
Output is correct |
20 |
Correct |
3 ms |
5212 KB |
Output is correct |
21 |
Correct |
2 ms |
5212 KB |
Output is correct |
22 |
Correct |
4 ms |
5212 KB |
Output is correct |
23 |
Correct |
2 ms |
5212 KB |
Output is correct |
24 |
Correct |
2 ms |
5212 KB |
Output is correct |
25 |
Correct |
2 ms |
5044 KB |
Output is correct |
26 |
Correct |
5 ms |
5212 KB |
Output is correct |
27 |
Correct |
7 ms |
5976 KB |
Output is correct |
28 |
Correct |
5 ms |
5980 KB |
Output is correct |
29 |
Correct |
8 ms |
6200 KB |
Output is correct |
30 |
Correct |
9 ms |
6124 KB |
Output is correct |
31 |
Correct |
3 ms |
5724 KB |
Output is correct |
32 |
Correct |
3 ms |
5724 KB |
Output is correct |
33 |
Correct |
3 ms |
5720 KB |
Output is correct |
34 |
Correct |
3 ms |
4956 KB |
Output is correct |
35 |
Correct |
3 ms |
4956 KB |
Output is correct |
36 |
Correct |
2 ms |
4956 KB |
Output is correct |
37 |
Correct |
3 ms |
4952 KB |
Output is correct |
38 |
Correct |
2 ms |
4956 KB |
Output is correct |
39 |
Correct |
2 ms |
4956 KB |
Output is correct |
40 |
Correct |
2 ms |
4956 KB |
Output is correct |
41 |
Correct |
2 ms |
4956 KB |
Output is correct |
42 |
Correct |
2 ms |
4956 KB |
Output is correct |
43 |
Correct |
2 ms |
4956 KB |
Output is correct |
44 |
Correct |
3 ms |
4956 KB |
Output is correct |
45 |
Correct |
2 ms |
4952 KB |
Output is correct |
46 |
Correct |
3 ms |
4956 KB |
Output is correct |
47 |
Correct |
2 ms |
5120 KB |
Output is correct |
48 |
Correct |
2 ms |
4956 KB |
Output is correct |
49 |
Correct |
2 ms |
5164 KB |
Output is correct |
50 |
Correct |
2 ms |
5148 KB |
Output is correct |
51 |
Correct |
2 ms |
4956 KB |
Output is correct |
52 |
Correct |
3 ms |
4952 KB |
Output is correct |
53 |
Correct |
2 ms |
4956 KB |
Output is correct |
54 |
Correct |
2 ms |
4956 KB |
Output is correct |
55 |
Correct |
2 ms |
4956 KB |
Output is correct |
56 |
Correct |
2 ms |
4956 KB |
Output is correct |
57 |
Correct |
2 ms |
4956 KB |
Output is correct |
58 |
Correct |
2 ms |
4956 KB |
Output is correct |
59 |
Correct |
2 ms |
5140 KB |
Output is correct |
60 |
Correct |
3 ms |
4956 KB |
Output is correct |
61 |
Correct |
3 ms |
4956 KB |
Output is correct |
62 |
Correct |
4 ms |
5212 KB |
Output is correct |
63 |
Correct |
2 ms |
4956 KB |
Output is correct |
64 |
Correct |
2 ms |
4956 KB |
Output is correct |
65 |
Correct |
2 ms |
4956 KB |
Output is correct |
66 |
Correct |
3 ms |
4956 KB |
Output is correct |
67 |
Correct |
3 ms |
5208 KB |
Output is correct |
68 |
Correct |
3 ms |
4960 KB |
Output is correct |
69 |
Correct |
3 ms |
5212 KB |
Output is correct |
70 |
Correct |
3 ms |
5212 KB |
Output is correct |
71 |
Correct |
3 ms |
5212 KB |
Output is correct |
72 |
Correct |
3 ms |
5212 KB |
Output is correct |
73 |
Correct |
4 ms |
5212 KB |
Output is correct |
74 |
Correct |
2 ms |
5212 KB |
Output is correct |
75 |
Correct |
2 ms |
5212 KB |
Output is correct |
76 |
Correct |
2 ms |
5208 KB |
Output is correct |
77 |
Correct |
3 ms |
5212 KB |
Output is correct |
78 |
Correct |
3 ms |
5212 KB |
Output is correct |
79 |
Correct |
3 ms |
5212 KB |
Output is correct |
80 |
Correct |
3 ms |
5212 KB |
Output is correct |
81 |
Correct |
3 ms |
5212 KB |
Output is correct |
82 |
Correct |
2 ms |
5212 KB |
Output is correct |
83 |
Correct |
3 ms |
4956 KB |
Output is correct |
84 |
Correct |
5 ms |
5212 KB |
Output is correct |
85 |
Correct |
5 ms |
5212 KB |
Output is correct |
86 |
Correct |
7 ms |
5212 KB |
Output is correct |
87 |
Correct |
5 ms |
5212 KB |
Output is correct |
88 |
Correct |
6 ms |
5212 KB |
Output is correct |
89 |
Correct |
8 ms |
5948 KB |
Output is correct |
90 |
Correct |
8 ms |
5680 KB |
Output is correct |
91 |
Correct |
5 ms |
5948 KB |
Output is correct |
92 |
Correct |
5 ms |
5720 KB |
Output is correct |
93 |
Correct |
4 ms |
5464 KB |
Output is correct |
94 |
Correct |
4 ms |
5924 KB |
Output is correct |
95 |
Correct |
4 ms |
5980 KB |
Output is correct |
96 |
Correct |
3 ms |
5724 KB |
Output is correct |
97 |
Correct |
8 ms |
5980 KB |
Output is correct |
98 |
Correct |
5 ms |
5724 KB |
Output is correct |
99 |
Correct |
7 ms |
5980 KB |
Output is correct |
100 |
Correct |
4 ms |
5468 KB |
Output is correct |
101 |
Correct |
6 ms |
5156 KB |
Output is correct |
102 |
Correct |
181 ms |
10320 KB |
Output is correct |
103 |
Correct |
221 ms |
10284 KB |
Output is correct |
104 |
Correct |
573 ms |
64740 KB |
Output is correct |
105 |
Correct |
196 ms |
12832 KB |
Output is correct |
106 |
Correct |
304 ms |
12316 KB |
Output is correct |
107 |
Correct |
383 ms |
51372 KB |
Output is correct |
108 |
Correct |
469 ms |
52440 KB |
Output is correct |
109 |
Correct |
75 ms |
43848 KB |
Output is correct |
110 |
Correct |
508 ms |
56180 KB |
Output is correct |
111 |
Correct |
478 ms |
62324 KB |
Output is correct |
112 |
Correct |
237 ms |
55636 KB |
Output is correct |
113 |
Correct |
115 ms |
33472 KB |
Output is correct |
114 |
Correct |
229 ms |
55424 KB |
Output is correct |
115 |
Correct |
435 ms |
69968 KB |
Output is correct |
116 |
Correct |
386 ms |
59648 KB |
Output is correct |
117 |
Correct |
208 ms |
39988 KB |
Output is correct |
118 |
Correct |
360 ms |
55884 KB |
Output is correct |
119 |
Correct |
347 ms |
17680 KB |
Output is correct |
120 |
Correct |
206 ms |
9804 KB |
Output is correct |