// In the name of Allah
#include <bits/stdc++.h>
#include "closing.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define F first
#define S second
#define endl '\n'
#define sep ' '
#define pb push_back
#define Mp make_pair
#define all(x) (x).begin(),(x).end()
#define len(x) ((ll) (x).size())
const int maxn = 2e5 + 7;
int n, u1, u2; ll R;
vector<pll> adj[maxn];
ll val[maxn], val1[maxn], val2[maxn];
ll sm1[maxn], sm2[maxn], mn1[maxn], mn2[maxn];
vector<ll> ls1; vector<pll> ls2;
void dfs(int v, int p = -1) {
for (auto f : adj[v]) {
int u = f.F; ll w = f.S;
if (u == p) continue;
val[u] = val[v] + w;
dfs(u, v);
}
}
int cal(ll R) {
sort(all(ls1)); sort(all(ls2));
for (int i = 0; i < len(ls1); i++) {
if (i == 0) sm1[i] = ls1[i];
else sm1[i] = sm1[i - 1] + ls1[i];
}
for (int i = 1; i <= len(ls2); i++) {
sm2[i] = sm2[i - 1] + ls2[i - 1].F;
}
for (int i = 0; i < len(ls2); i++) {
mn1[i] = ls2[i].S - ls2[i].F; mn2[i] = ls2[i].S;
}
for (int i = 1; i < len(ls2); i++) mn1[i] = min(mn1[i], mn1[i - 1]);
for (int i = len(ls2) - 2; i >= 0; i--) mn2[i] = min(mn2[i], mn2[i + 1]);
int ans = 0;
for (int i = 0; i <= 2 * len(ls2); i++) {
int x = i, j = i / 2;
if (i % 2 == 0) {
ll w = R - sm2[j];
if (w >= 0) {
x += upper_bound(sm1, sm1 + len(ls1), w) - sm1;
ans = max(ans, x);
}
}
else {
ll wx = min(mn1[j] + ls2[j].F, mn2[j]);
ll w = R - sm2[j] - wx;
if (w >= 0) {
x += upper_bound(sm1, sm1 + len(ls1), w) - sm1;
ans = max(ans, x);
}
}
}
return ans;
}
int max_score(int N, int X, int Y, long long K, vector<int> U, vector<int> V, vector<int> W) {
n = N; u1 = X; u2 = Y; R = K;
for (int i = 0; i < n; i++) adj[i].clear();
for (int i = 0; i < n - 1; i++) {
int u = U[i], v = V[i]; ll w = W[i];
adj[u].pb(Mp(v, w)); adj[v].pb(Mp(u, w));
}
val[u1] = 0; dfs(u1);
for (int i = 0; i < n; i++) val1[i] = val[i];
val[u2] = 0; dfs(u2);
for (int i = 0; i < n; i++) val2[i] = val[i];
for (int i = 0; i < n; i++) {
if (2 * min(val1[i], val2[i]) <= max(val1[i], val2[i])) {
ls1.pb(min(val1[i], val2[i]));
ls1.pb(max(val1[i], val2[i]) - min(val1[i], val2[i]));
}
else {
ls2.pb(Mp(max(val1[i], val2[i]), min(val1[i], val2[i])));
}
}
int ans = 0;
ls1.clear(); ls2.clear();
for (int i = 0; i < n; i++) {
ls1.pb(min(val1[i], val2[i]));
}
ans = max(ans, cal(R));
for (int v = 0; v < n; v++) {
if (val1[v] + val2[v] != val1[u2]) continue;
if (max(val1[v], val2[v]) > R) continue;
int x = 0; ll valx = R;
ls1.clear(); ls2.clear();
for (int i = 0; i < n; i++) {
if (val1[i] + val2[i] == val1[u2]) {
if (i == v) {
valx -= max(val1[i], val2[i]); x += 2;
}
else {
if (val1[i] < val1[v]) {
valx -= val1[i]; x += 1;
ls1.pb(max(0ll, val2[i] - val1[i]));
}
else {
valx -= val2[i]; x += 1;
ls1.pb(max(0ll, val1[i] - val2[i]));
}
}
}
else {
if (2 * min(val1[i], val2[i]) <= max(val1[i], val2[i])) {
ls1.pb(min(val1[i], val2[i]));
ls1.pb(max(val1[i], val2[i]) - min(val1[i], val2[i]));
}
else {
ls2.pb(Mp(max(val1[i], val2[i]), min(val1[i], val2[i])));
}
}
}
if (valx >= 0) ans = max(ans, x + cal(valx));
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
5208 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
89 ms |
32356 KB |
Output is correct |
2 |
Correct |
96 ms |
38692 KB |
Output is correct |
3 |
Correct |
48 ms |
10380 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4952 KB |
Output is correct |
2 |
Correct |
2 ms |
4952 KB |
Output is correct |
3 |
Correct |
2 ms |
4956 KB |
Output is correct |
4 |
Correct |
2 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 |
3 ms |
4952 KB |
Output is correct |
2 |
Correct |
2 ms |
4952 KB |
Output is correct |
3 |
Correct |
2 ms |
4956 KB |
Output is correct |
4 |
Correct |
2 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 |
3 ms |
4952 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 |
5212 KB |
Output is correct |
20 |
Correct |
3 ms |
5212 KB |
Output is correct |
21 |
Correct |
6 ms |
5212 KB |
Output is correct |
22 |
Correct |
3 ms |
5208 KB |
Output is correct |
23 |
Correct |
3 ms |
5212 KB |
Output is correct |
24 |
Correct |
3 ms |
5212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4952 KB |
Output is correct |
2 |
Correct |
2 ms |
4952 KB |
Output is correct |
3 |
Correct |
2 ms |
4956 KB |
Output is correct |
4 |
Correct |
2 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 |
3 ms |
4952 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 |
5212 KB |
Output is correct |
20 |
Correct |
3 ms |
5212 KB |
Output is correct |
21 |
Correct |
6 ms |
5212 KB |
Output is correct |
22 |
Correct |
3 ms |
5208 KB |
Output is correct |
23 |
Correct |
3 ms |
5212 KB |
Output is correct |
24 |
Correct |
3 ms |
5212 KB |
Output is correct |
25 |
Correct |
4 ms |
5208 KB |
Output is correct |
26 |
Correct |
3 ms |
5724 KB |
Output is correct |
27 |
Correct |
3 ms |
5724 KB |
Output is correct |
28 |
Correct |
175 ms |
5600 KB |
Output is correct |
29 |
Correct |
158 ms |
5464 KB |
Output is correct |
30 |
Correct |
12 ms |
5468 KB |
Output is correct |
31 |
Correct |
21 ms |
5480 KB |
Output is correct |
32 |
Correct |
21 ms |
5724 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
5208 KB |
Output is correct |
2 |
Correct |
3 ms |
4952 KB |
Output is correct |
3 |
Correct |
2 ms |
4952 KB |
Output is correct |
4 |
Correct |
2 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 |
4952 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 |
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 |
3 ms |
4952 KB |
Output is correct |
19 |
Correct |
2 ms |
4956 KB |
Output is correct |
20 |
Correct |
2 ms |
4956 KB |
Output is correct |
21 |
Correct |
3 ms |
4952 KB |
Output is correct |
22 |
Correct |
2 ms |
4956 KB |
Output is correct |
23 |
Correct |
2 ms |
4952 KB |
Output is correct |
24 |
Correct |
2 ms |
4956 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
5208 KB |
Output is correct |
2 |
Correct |
3 ms |
4952 KB |
Output is correct |
3 |
Correct |
2 ms |
4952 KB |
Output is correct |
4 |
Correct |
2 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 |
4956 KB |
Output is correct |
13 |
Correct |
3 ms |
4952 KB |
Output is correct |
14 |
Correct |
2 ms |
4952 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 |
4952 KB |
Output is correct |
20 |
Correct |
2 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 |
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 |
2 ms |
4956 KB |
Output is correct |
30 |
Correct |
3 ms |
4952 KB |
Output is correct |
31 |
Correct |
2 ms |
4956 KB |
Output is correct |
32 |
Correct |
2 ms |
4956 KB |
Output is correct |
33 |
Correct |
3 ms |
4952 KB |
Output is correct |
34 |
Correct |
2 ms |
4956 KB |
Output is correct |
35 |
Correct |
2 ms |
4952 KB |
Output is correct |
36 |
Correct |
2 ms |
4956 KB |
Output is correct |
37 |
Correct |
2 ms |
4956 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 |
5004 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 |
5152 KB |
Output is correct |
44 |
Correct |
2 ms |
4956 KB |
Output is correct |
45 |
Correct |
2 ms |
4956 KB |
Output is correct |
46 |
Correct |
2 ms |
4952 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 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
5208 KB |
Output is correct |
2 |
Correct |
3 ms |
4952 KB |
Output is correct |
3 |
Correct |
2 ms |
4952 KB |
Output is correct |
4 |
Correct |
2 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 |
4956 KB |
Output is correct |
13 |
Correct |
3 ms |
4952 KB |
Output is correct |
14 |
Correct |
2 ms |
4952 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 |
2 ms |
5212 KB |
Output is correct |
21 |
Correct |
3 ms |
5212 KB |
Output is correct |
22 |
Correct |
6 ms |
5212 KB |
Output is correct |
23 |
Correct |
3 ms |
5208 KB |
Output is correct |
24 |
Correct |
3 ms |
5212 KB |
Output is correct |
25 |
Correct |
3 ms |
5212 KB |
Output is correct |
26 |
Correct |
2 ms |
4952 KB |
Output is correct |
27 |
Correct |
2 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 |
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 |
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 |
3 ms |
4952 KB |
Output is correct |
41 |
Correct |
2 ms |
4956 KB |
Output is correct |
42 |
Correct |
2 ms |
4952 KB |
Output is correct |
43 |
Correct |
2 ms |
4956 KB |
Output is correct |
44 |
Correct |
2 ms |
4956 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 |
5004 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 |
5152 KB |
Output is correct |
51 |
Correct |
2 ms |
4956 KB |
Output is correct |
52 |
Correct |
2 ms |
4956 KB |
Output is correct |
53 |
Correct |
2 ms |
4952 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 |
5212 KB |
Output is correct |
60 |
Correct |
2 ms |
4956 KB |
Output is correct |
61 |
Correct |
2 ms |
5212 KB |
Output is correct |
62 |
Correct |
3 ms |
5212 KB |
Output is correct |
63 |
Correct |
2 ms |
5212 KB |
Output is correct |
64 |
Correct |
2 ms |
5208 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 |
5 ms |
5212 KB |
Output is correct |
69 |
Correct |
6 ms |
5208 KB |
Output is correct |
70 |
Correct |
2 ms |
5212 KB |
Output is correct |
71 |
Correct |
3 ms |
5040 KB |
Output is correct |
72 |
Correct |
3 ms |
5208 KB |
Output is correct |
73 |
Correct |
2 ms |
5216 KB |
Output is correct |
74 |
Correct |
2 ms |
5208 KB |
Output is correct |
75 |
Correct |
2 ms |
5212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
5208 KB |
Output is correct |
2 |
Correct |
3 ms |
4952 KB |
Output is correct |
3 |
Correct |
2 ms |
4952 KB |
Output is correct |
4 |
Correct |
2 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 |
4956 KB |
Output is correct |
13 |
Correct |
3 ms |
4952 KB |
Output is correct |
14 |
Correct |
2 ms |
4952 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 |
2 ms |
5212 KB |
Output is correct |
21 |
Correct |
3 ms |
5212 KB |
Output is correct |
22 |
Correct |
6 ms |
5212 KB |
Output is correct |
23 |
Correct |
3 ms |
5208 KB |
Output is correct |
24 |
Correct |
3 ms |
5212 KB |
Output is correct |
25 |
Correct |
3 ms |
5212 KB |
Output is correct |
26 |
Correct |
4 ms |
5208 KB |
Output is correct |
27 |
Correct |
3 ms |
5724 KB |
Output is correct |
28 |
Correct |
3 ms |
5724 KB |
Output is correct |
29 |
Correct |
175 ms |
5600 KB |
Output is correct |
30 |
Correct |
158 ms |
5464 KB |
Output is correct |
31 |
Correct |
12 ms |
5468 KB |
Output is correct |
32 |
Correct |
21 ms |
5480 KB |
Output is correct |
33 |
Correct |
21 ms |
5724 KB |
Output is correct |
34 |
Correct |
2 ms |
4952 KB |
Output is correct |
35 |
Correct |
2 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 |
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 |
4956 KB |
Output is correct |
45 |
Correct |
3 ms |
4952 KB |
Output is correct |
46 |
Correct |
2 ms |
4956 KB |
Output is correct |
47 |
Correct |
2 ms |
4956 KB |
Output is correct |
48 |
Correct |
3 ms |
4952 KB |
Output is correct |
49 |
Correct |
2 ms |
4956 KB |
Output is correct |
50 |
Correct |
2 ms |
4952 KB |
Output is correct |
51 |
Correct |
2 ms |
4956 KB |
Output is correct |
52 |
Correct |
2 ms |
4956 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 |
5004 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 |
5152 KB |
Output is correct |
59 |
Correct |
2 ms |
4956 KB |
Output is correct |
60 |
Correct |
2 ms |
4956 KB |
Output is correct |
61 |
Correct |
2 ms |
4952 KB |
Output is correct |
62 |
Correct |
2 ms |
4956 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 |
2 ms |
4956 KB |
Output is correct |
67 |
Correct |
2 ms |
5212 KB |
Output is correct |
68 |
Correct |
2 ms |
4956 KB |
Output is correct |
69 |
Correct |
2 ms |
5212 KB |
Output is correct |
70 |
Correct |
3 ms |
5212 KB |
Output is correct |
71 |
Correct |
2 ms |
5212 KB |
Output is correct |
72 |
Correct |
2 ms |
5208 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 |
5 ms |
5212 KB |
Output is correct |
77 |
Correct |
6 ms |
5208 KB |
Output is correct |
78 |
Correct |
2 ms |
5212 KB |
Output is correct |
79 |
Correct |
3 ms |
5040 KB |
Output is correct |
80 |
Correct |
3 ms |
5208 KB |
Output is correct |
81 |
Correct |
2 ms |
5216 KB |
Output is correct |
82 |
Correct |
2 ms |
5208 KB |
Output is correct |
83 |
Correct |
2 ms |
5212 KB |
Output is correct |
84 |
Correct |
3 ms |
5208 KB |
Output is correct |
85 |
Correct |
4 ms |
5212 KB |
Output is correct |
86 |
Correct |
5 ms |
5148 KB |
Output is correct |
87 |
Correct |
6 ms |
5208 KB |
Output is correct |
88 |
Correct |
7 ms |
5212 KB |
Output is correct |
89 |
Correct |
4 ms |
5724 KB |
Output is correct |
90 |
Correct |
5 ms |
5468 KB |
Output is correct |
91 |
Correct |
30 ms |
5712 KB |
Output is correct |
92 |
Correct |
4 ms |
5468 KB |
Output is correct |
93 |
Correct |
5 ms |
5468 KB |
Output is correct |
94 |
Correct |
24 ms |
5468 KB |
Output is correct |
95 |
Correct |
156 ms |
5464 KB |
Output is correct |
96 |
Correct |
15 ms |
5464 KB |
Output is correct |
97 |
Correct |
226 ms |
5464 KB |
Output is correct |
98 |
Correct |
7 ms |
5468 KB |
Output is correct |
99 |
Correct |
4 ms |
5724 KB |
Output is correct |
100 |
Correct |
4 ms |
5464 KB |
Output is correct |
101 |
Correct |
3 ms |
5212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
5208 KB |
Output is correct |
2 |
Correct |
3 ms |
4952 KB |
Output is correct |
3 |
Correct |
2 ms |
4952 KB |
Output is correct |
4 |
Correct |
2 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 |
4956 KB |
Output is correct |
13 |
Correct |
3 ms |
4952 KB |
Output is correct |
14 |
Correct |
2 ms |
4952 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 |
2 ms |
5212 KB |
Output is correct |
21 |
Correct |
3 ms |
5212 KB |
Output is correct |
22 |
Correct |
6 ms |
5212 KB |
Output is correct |
23 |
Correct |
3 ms |
5208 KB |
Output is correct |
24 |
Correct |
3 ms |
5212 KB |
Output is correct |
25 |
Correct |
3 ms |
5212 KB |
Output is correct |
26 |
Correct |
4 ms |
5208 KB |
Output is correct |
27 |
Correct |
3 ms |
5724 KB |
Output is correct |
28 |
Correct |
3 ms |
5724 KB |
Output is correct |
29 |
Correct |
175 ms |
5600 KB |
Output is correct |
30 |
Correct |
158 ms |
5464 KB |
Output is correct |
31 |
Correct |
12 ms |
5468 KB |
Output is correct |
32 |
Correct |
21 ms |
5480 KB |
Output is correct |
33 |
Correct |
21 ms |
5724 KB |
Output is correct |
34 |
Correct |
2 ms |
4952 KB |
Output is correct |
35 |
Correct |
2 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 |
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 |
4956 KB |
Output is correct |
45 |
Correct |
3 ms |
4952 KB |
Output is correct |
46 |
Correct |
2 ms |
4956 KB |
Output is correct |
47 |
Correct |
2 ms |
4956 KB |
Output is correct |
48 |
Correct |
3 ms |
4952 KB |
Output is correct |
49 |
Correct |
2 ms |
4956 KB |
Output is correct |
50 |
Correct |
2 ms |
4952 KB |
Output is correct |
51 |
Correct |
2 ms |
4956 KB |
Output is correct |
52 |
Correct |
2 ms |
4956 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 |
5004 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 |
5152 KB |
Output is correct |
59 |
Correct |
2 ms |
4956 KB |
Output is correct |
60 |
Correct |
2 ms |
4956 KB |
Output is correct |
61 |
Correct |
2 ms |
4952 KB |
Output is correct |
62 |
Correct |
2 ms |
4956 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 |
2 ms |
4956 KB |
Output is correct |
67 |
Correct |
2 ms |
5212 KB |
Output is correct |
68 |
Correct |
2 ms |
4956 KB |
Output is correct |
69 |
Correct |
2 ms |
5212 KB |
Output is correct |
70 |
Correct |
3 ms |
5212 KB |
Output is correct |
71 |
Correct |
2 ms |
5212 KB |
Output is correct |
72 |
Correct |
2 ms |
5208 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 |
5 ms |
5212 KB |
Output is correct |
77 |
Correct |
6 ms |
5208 KB |
Output is correct |
78 |
Correct |
2 ms |
5212 KB |
Output is correct |
79 |
Correct |
3 ms |
5040 KB |
Output is correct |
80 |
Correct |
3 ms |
5208 KB |
Output is correct |
81 |
Correct |
2 ms |
5216 KB |
Output is correct |
82 |
Correct |
2 ms |
5208 KB |
Output is correct |
83 |
Correct |
2 ms |
5212 KB |
Output is correct |
84 |
Correct |
3 ms |
5208 KB |
Output is correct |
85 |
Correct |
4 ms |
5212 KB |
Output is correct |
86 |
Correct |
5 ms |
5148 KB |
Output is correct |
87 |
Correct |
6 ms |
5208 KB |
Output is correct |
88 |
Correct |
7 ms |
5212 KB |
Output is correct |
89 |
Correct |
4 ms |
5724 KB |
Output is correct |
90 |
Correct |
5 ms |
5468 KB |
Output is correct |
91 |
Correct |
30 ms |
5712 KB |
Output is correct |
92 |
Correct |
4 ms |
5468 KB |
Output is correct |
93 |
Correct |
5 ms |
5468 KB |
Output is correct |
94 |
Correct |
24 ms |
5468 KB |
Output is correct |
95 |
Correct |
156 ms |
5464 KB |
Output is correct |
96 |
Correct |
15 ms |
5464 KB |
Output is correct |
97 |
Correct |
226 ms |
5464 KB |
Output is correct |
98 |
Correct |
7 ms |
5468 KB |
Output is correct |
99 |
Correct |
4 ms |
5724 KB |
Output is correct |
100 |
Correct |
4 ms |
5464 KB |
Output is correct |
101 |
Correct |
3 ms |
5212 KB |
Output is correct |
102 |
Correct |
104 ms |
10304 KB |
Output is correct |
103 |
Correct |
111 ms |
10324 KB |
Output is correct |
104 |
Execution timed out |
1089 ms |
38144 KB |
Time limit exceeded |
105 |
Halted |
0 ms |
0 KB |
- |