#include "closing.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<vector<pair<int,ll>>> ad;
vector<ll> on_path, dist, prv;
int n;
void dfs(int v, int p){
for(auto [u, w]: ad[v]){
if(u == p) continue;
prv[u] = v;
dist[u] = dist[v]+w;
dfs(u, v);
}
}
int greedy(ll k, int s1, int s2){
priority_queue<array<ll, 3>, vector<array<ll, 3>>, greater<>> pq;
pq.push({0, s1, -1}); pq.push({0, s2, -1});
int ct = 0;
while(pq.size()){
auto [c, v, prv] = pq.top(); pq.pop();
if(k-c < 0) return ct;
k -= c; ct++;
for(auto [u, w]: ad[v]){
if(u == prv) continue;
pq.push({c+w, u, v});
}
}
return ct;
}
int max_score(int N, int X, int Y, long long K, std::vector<int> U, std::vector<int> V, std::vector<int> W)
{
n = N;
ad.assign(N, vector<pair<int,ll>>());
for(int i=0; i<N-1; i++){
ad[U[i]].push_back({V[i], W[i]});
ad[V[i]].push_back({U[i], W[i]});
}
dist.assign(n, 0); prv.assign(n, -1); on_path.assign(n, 0);
dfs(X, -1);
int curr = Y, path_sz = 0;
while(curr != -1){
on_path[curr] = 1; path_sz++;
curr = prv[curr];
}
vector<ll> distX = dist;
dist.assign(n, 0); dfs(Y, -1);
vector<ll> distY = dist;
int ans = greedy(K, X, Y);
if(distX[Y] > K*2) return ans;
vector dp(n+1, vector<ll>(2*n+1, 1e18+1));
dp[0][path_sz] = 0;
for(int i=0; i<n; i++){
if(!on_path[i]) continue;
dp[0][path_sz] += min(distX[i], distY[i]);
}
for(int i=0; i<n; i++){
dp[i+1] = dp[i];
if(!on_path[i]){
ll d1 = min(distX[i], distY[i]), d2 = max(distX[i], distY[i]);
for(int j=0; j<2*n; j++){
dp[i+1][j+1] = min(dp[i+1][j+1], dp[i][j] + d1);
if(j+2 < 2*n+1) dp[i+1][j+2] = min(dp[i+1][j+2], dp[i][j] + d2);
}
}
else{
ll d = abs(distX[i] - distY[i]);
for(int j=0; j<2*n; j++){
dp[i+1][j+1] = min(dp[i+1][j+1], dp[i][j] + d);
}
}
}
for(int i=0; i<2*n+1; i++){
if(dp[n][i] <= K) ans = max(ans, i);
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
96 ms |
32340 KB |
Output is correct |
2 |
Correct |
113 ms |
37200 KB |
Output is correct |
3 |
Correct |
48 ms |
2896 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
1 ms |
344 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
436 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
536 KB |
Output is correct |
11 |
Correct |
0 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
1 ms |
344 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
436 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
536 KB |
Output is correct |
11 |
Correct |
0 ms |
344 KB |
Output is correct |
12 |
Correct |
0 ms |
604 KB |
Output is correct |
13 |
Correct |
0 ms |
600 KB |
Output is correct |
14 |
Correct |
1 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
1 ms |
604 KB |
Output is correct |
17 |
Correct |
0 ms |
604 KB |
Output is correct |
18 |
Correct |
1 ms |
348 KB |
Output is correct |
19 |
Correct |
3 ms |
4444 KB |
Output is correct |
20 |
Correct |
3 ms |
3676 KB |
Output is correct |
21 |
Correct |
2 ms |
4144 KB |
Output is correct |
22 |
Correct |
3 ms |
4444 KB |
Output is correct |
23 |
Correct |
3 ms |
4444 KB |
Output is correct |
24 |
Correct |
3 ms |
4440 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
1 ms |
344 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
436 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
536 KB |
Output is correct |
11 |
Correct |
0 ms |
344 KB |
Output is correct |
12 |
Correct |
0 ms |
604 KB |
Output is correct |
13 |
Correct |
0 ms |
600 KB |
Output is correct |
14 |
Correct |
1 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
1 ms |
604 KB |
Output is correct |
17 |
Correct |
0 ms |
604 KB |
Output is correct |
18 |
Correct |
1 ms |
348 KB |
Output is correct |
19 |
Correct |
3 ms |
4444 KB |
Output is correct |
20 |
Correct |
3 ms |
3676 KB |
Output is correct |
21 |
Correct |
2 ms |
4144 KB |
Output is correct |
22 |
Correct |
3 ms |
4444 KB |
Output is correct |
23 |
Correct |
3 ms |
4444 KB |
Output is correct |
24 |
Correct |
3 ms |
4440 KB |
Output is correct |
25 |
Correct |
2 ms |
600 KB |
Output is correct |
26 |
Correct |
96 ms |
141916 KB |
Output is correct |
27 |
Correct |
86 ms |
122708 KB |
Output is correct |
28 |
Correct |
66 ms |
124500 KB |
Output is correct |
29 |
Correct |
81 ms |
134736 KB |
Output is correct |
30 |
Correct |
80 ms |
121700 KB |
Output is correct |
31 |
Correct |
75 ms |
142144 KB |
Output is correct |
32 |
Correct |
76 ms |
141908 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
1 ms |
344 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
1 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
344 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
1 ms |
344 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
436 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
536 KB |
Output is correct |
12 |
Correct |
0 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
604 KB |
Output is correct |
14 |
Correct |
0 ms |
600 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
1 ms |
348 KB |
Output is correct |
17 |
Correct |
1 ms |
604 KB |
Output is correct |
18 |
Correct |
0 ms |
604 KB |
Output is correct |
19 |
Correct |
1 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
1 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
344 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
1 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
344 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
1 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
1 ms |
604 KB |
Output is correct |
40 |
Correct |
0 ms |
580 KB |
Output is correct |
41 |
Correct |
0 ms |
604 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
1 ms |
600 KB |
Output is correct |
44 |
Correct |
1 ms |
348 KB |
Output is correct |
45 |
Correct |
1 ms |
604 KB |
Output is correct |
46 |
Correct |
0 ms |
576 KB |
Output is correct |
47 |
Correct |
0 ms |
600 KB |
Output is correct |
48 |
Correct |
1 ms |
348 KB |
Output is correct |
49 |
Correct |
1 ms |
348 KB |
Output is correct |
50 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
1 ms |
344 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
436 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
536 KB |
Output is correct |
12 |
Correct |
0 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
604 KB |
Output is correct |
14 |
Correct |
0 ms |
600 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
1 ms |
348 KB |
Output is correct |
17 |
Correct |
1 ms |
604 KB |
Output is correct |
18 |
Correct |
0 ms |
604 KB |
Output is correct |
19 |
Correct |
1 ms |
348 KB |
Output is correct |
20 |
Correct |
3 ms |
4444 KB |
Output is correct |
21 |
Correct |
3 ms |
3676 KB |
Output is correct |
22 |
Correct |
2 ms |
4144 KB |
Output is correct |
23 |
Correct |
3 ms |
4444 KB |
Output is correct |
24 |
Correct |
3 ms |
4444 KB |
Output is correct |
25 |
Correct |
3 ms |
4440 KB |
Output is correct |
26 |
Correct |
1 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
1 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
344 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
344 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
1 ms |
348 KB |
Output is correct |
45 |
Correct |
0 ms |
348 KB |
Output is correct |
46 |
Correct |
1 ms |
604 KB |
Output is correct |
47 |
Correct |
0 ms |
580 KB |
Output is correct |
48 |
Correct |
0 ms |
604 KB |
Output is correct |
49 |
Correct |
0 ms |
348 KB |
Output is correct |
50 |
Correct |
1 ms |
600 KB |
Output is correct |
51 |
Correct |
1 ms |
348 KB |
Output is correct |
52 |
Correct |
1 ms |
604 KB |
Output is correct |
53 |
Correct |
0 ms |
576 KB |
Output is correct |
54 |
Correct |
0 ms |
600 KB |
Output is correct |
55 |
Correct |
1 ms |
348 KB |
Output is correct |
56 |
Correct |
1 ms |
348 KB |
Output is correct |
57 |
Correct |
0 ms |
348 KB |
Output is correct |
58 |
Correct |
1 ms |
344 KB |
Output is correct |
59 |
Correct |
1 ms |
588 KB |
Output is correct |
60 |
Correct |
1 ms |
604 KB |
Output is correct |
61 |
Correct |
1 ms |
640 KB |
Output is correct |
62 |
Correct |
1 ms |
644 KB |
Output is correct |
63 |
Correct |
3 ms |
4444 KB |
Output is correct |
64 |
Correct |
3 ms |
3932 KB |
Output is correct |
65 |
Correct |
2 ms |
3676 KB |
Output is correct |
66 |
Correct |
3 ms |
3928 KB |
Output is correct |
67 |
Correct |
3 ms |
4188 KB |
Output is correct |
68 |
Correct |
2 ms |
3676 KB |
Output is correct |
69 |
Correct |
3 ms |
4184 KB |
Output is correct |
70 |
Correct |
3 ms |
3928 KB |
Output is correct |
71 |
Correct |
3 ms |
3932 KB |
Output is correct |
72 |
Correct |
3 ms |
4188 KB |
Output is correct |
73 |
Correct |
2 ms |
2652 KB |
Output is correct |
74 |
Correct |
2 ms |
3164 KB |
Output is correct |
75 |
Correct |
1 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
1 ms |
344 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
436 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
536 KB |
Output is correct |
12 |
Correct |
0 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
604 KB |
Output is correct |
14 |
Correct |
0 ms |
600 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
1 ms |
348 KB |
Output is correct |
17 |
Correct |
1 ms |
604 KB |
Output is correct |
18 |
Correct |
0 ms |
604 KB |
Output is correct |
19 |
Correct |
1 ms |
348 KB |
Output is correct |
20 |
Correct |
3 ms |
4444 KB |
Output is correct |
21 |
Correct |
3 ms |
3676 KB |
Output is correct |
22 |
Correct |
2 ms |
4144 KB |
Output is correct |
23 |
Correct |
3 ms |
4444 KB |
Output is correct |
24 |
Correct |
3 ms |
4444 KB |
Output is correct |
25 |
Correct |
3 ms |
4440 KB |
Output is correct |
26 |
Correct |
2 ms |
600 KB |
Output is correct |
27 |
Correct |
96 ms |
141916 KB |
Output is correct |
28 |
Correct |
86 ms |
122708 KB |
Output is correct |
29 |
Correct |
66 ms |
124500 KB |
Output is correct |
30 |
Correct |
81 ms |
134736 KB |
Output is correct |
31 |
Correct |
80 ms |
121700 KB |
Output is correct |
32 |
Correct |
75 ms |
142144 KB |
Output is correct |
33 |
Correct |
76 ms |
141908 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
1 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
344 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
1 ms |
348 KB |
Output is correct |
45 |
Correct |
0 ms |
348 KB |
Output is correct |
46 |
Correct |
0 ms |
344 KB |
Output is correct |
47 |
Correct |
0 ms |
348 KB |
Output is correct |
48 |
Correct |
0 ms |
348 KB |
Output is correct |
49 |
Correct |
0 ms |
348 KB |
Output is correct |
50 |
Correct |
0 ms |
348 KB |
Output is correct |
51 |
Correct |
0 ms |
348 KB |
Output is correct |
52 |
Correct |
1 ms |
348 KB |
Output is correct |
53 |
Correct |
0 ms |
348 KB |
Output is correct |
54 |
Correct |
1 ms |
604 KB |
Output is correct |
55 |
Correct |
0 ms |
580 KB |
Output is correct |
56 |
Correct |
0 ms |
604 KB |
Output is correct |
57 |
Correct |
0 ms |
348 KB |
Output is correct |
58 |
Correct |
1 ms |
600 KB |
Output is correct |
59 |
Correct |
1 ms |
348 KB |
Output is correct |
60 |
Correct |
1 ms |
604 KB |
Output is correct |
61 |
Correct |
0 ms |
576 KB |
Output is correct |
62 |
Correct |
0 ms |
600 KB |
Output is correct |
63 |
Correct |
1 ms |
348 KB |
Output is correct |
64 |
Correct |
1 ms |
348 KB |
Output is correct |
65 |
Correct |
0 ms |
348 KB |
Output is correct |
66 |
Correct |
1 ms |
344 KB |
Output is correct |
67 |
Correct |
1 ms |
588 KB |
Output is correct |
68 |
Correct |
1 ms |
604 KB |
Output is correct |
69 |
Correct |
1 ms |
640 KB |
Output is correct |
70 |
Correct |
1 ms |
644 KB |
Output is correct |
71 |
Correct |
3 ms |
4444 KB |
Output is correct |
72 |
Correct |
3 ms |
3932 KB |
Output is correct |
73 |
Correct |
2 ms |
3676 KB |
Output is correct |
74 |
Correct |
3 ms |
3928 KB |
Output is correct |
75 |
Correct |
3 ms |
4188 KB |
Output is correct |
76 |
Correct |
2 ms |
3676 KB |
Output is correct |
77 |
Correct |
3 ms |
4184 KB |
Output is correct |
78 |
Correct |
3 ms |
3928 KB |
Output is correct |
79 |
Correct |
3 ms |
3932 KB |
Output is correct |
80 |
Correct |
3 ms |
4188 KB |
Output is correct |
81 |
Correct |
2 ms |
2652 KB |
Output is correct |
82 |
Correct |
2 ms |
3164 KB |
Output is correct |
83 |
Correct |
1 ms |
604 KB |
Output is correct |
84 |
Correct |
2 ms |
604 KB |
Output is correct |
85 |
Correct |
7 ms |
1628 KB |
Output is correct |
86 |
Correct |
3 ms |
680 KB |
Output is correct |
87 |
Correct |
4 ms |
884 KB |
Output is correct |
88 |
Correct |
5 ms |
888 KB |
Output is correct |
89 |
Correct |
97 ms |
141892 KB |
Output is correct |
90 |
Correct |
77 ms |
116428 KB |
Output is correct |
91 |
Correct |
93 ms |
140680 KB |
Output is correct |
92 |
Correct |
82 ms |
122204 KB |
Output is correct |
93 |
Correct |
82 ms |
124680 KB |
Output is correct |
94 |
Correct |
74 ms |
128700 KB |
Output is correct |
95 |
Correct |
76 ms |
134992 KB |
Output is correct |
96 |
Correct |
71 ms |
118096 KB |
Output is correct |
97 |
Correct |
88 ms |
134224 KB |
Output is correct |
98 |
Correct |
89 ms |
130504 KB |
Output is correct |
99 |
Correct |
96 ms |
141908 KB |
Output is correct |
100 |
Correct |
51 ms |
68696 KB |
Output is correct |
101 |
Correct |
12 ms |
4316 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
1 ms |
344 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
436 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
536 KB |
Output is correct |
12 |
Correct |
0 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
604 KB |
Output is correct |
14 |
Correct |
0 ms |
600 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
1 ms |
348 KB |
Output is correct |
17 |
Correct |
1 ms |
604 KB |
Output is correct |
18 |
Correct |
0 ms |
604 KB |
Output is correct |
19 |
Correct |
1 ms |
348 KB |
Output is correct |
20 |
Correct |
3 ms |
4444 KB |
Output is correct |
21 |
Correct |
3 ms |
3676 KB |
Output is correct |
22 |
Correct |
2 ms |
4144 KB |
Output is correct |
23 |
Correct |
3 ms |
4444 KB |
Output is correct |
24 |
Correct |
3 ms |
4444 KB |
Output is correct |
25 |
Correct |
3 ms |
4440 KB |
Output is correct |
26 |
Correct |
2 ms |
600 KB |
Output is correct |
27 |
Correct |
96 ms |
141916 KB |
Output is correct |
28 |
Correct |
86 ms |
122708 KB |
Output is correct |
29 |
Correct |
66 ms |
124500 KB |
Output is correct |
30 |
Correct |
81 ms |
134736 KB |
Output is correct |
31 |
Correct |
80 ms |
121700 KB |
Output is correct |
32 |
Correct |
75 ms |
142144 KB |
Output is correct |
33 |
Correct |
76 ms |
141908 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
1 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
344 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
1 ms |
348 KB |
Output is correct |
45 |
Correct |
0 ms |
348 KB |
Output is correct |
46 |
Correct |
0 ms |
344 KB |
Output is correct |
47 |
Correct |
0 ms |
348 KB |
Output is correct |
48 |
Correct |
0 ms |
348 KB |
Output is correct |
49 |
Correct |
0 ms |
348 KB |
Output is correct |
50 |
Correct |
0 ms |
348 KB |
Output is correct |
51 |
Correct |
0 ms |
348 KB |
Output is correct |
52 |
Correct |
1 ms |
348 KB |
Output is correct |
53 |
Correct |
0 ms |
348 KB |
Output is correct |
54 |
Correct |
1 ms |
604 KB |
Output is correct |
55 |
Correct |
0 ms |
580 KB |
Output is correct |
56 |
Correct |
0 ms |
604 KB |
Output is correct |
57 |
Correct |
0 ms |
348 KB |
Output is correct |
58 |
Correct |
1 ms |
600 KB |
Output is correct |
59 |
Correct |
1 ms |
348 KB |
Output is correct |
60 |
Correct |
1 ms |
604 KB |
Output is correct |
61 |
Correct |
0 ms |
576 KB |
Output is correct |
62 |
Correct |
0 ms |
600 KB |
Output is correct |
63 |
Correct |
1 ms |
348 KB |
Output is correct |
64 |
Correct |
1 ms |
348 KB |
Output is correct |
65 |
Correct |
0 ms |
348 KB |
Output is correct |
66 |
Correct |
1 ms |
344 KB |
Output is correct |
67 |
Correct |
1 ms |
588 KB |
Output is correct |
68 |
Correct |
1 ms |
604 KB |
Output is correct |
69 |
Correct |
1 ms |
640 KB |
Output is correct |
70 |
Correct |
1 ms |
644 KB |
Output is correct |
71 |
Correct |
3 ms |
4444 KB |
Output is correct |
72 |
Correct |
3 ms |
3932 KB |
Output is correct |
73 |
Correct |
2 ms |
3676 KB |
Output is correct |
74 |
Correct |
3 ms |
3928 KB |
Output is correct |
75 |
Correct |
3 ms |
4188 KB |
Output is correct |
76 |
Correct |
2 ms |
3676 KB |
Output is correct |
77 |
Correct |
3 ms |
4184 KB |
Output is correct |
78 |
Correct |
3 ms |
3928 KB |
Output is correct |
79 |
Correct |
3 ms |
3932 KB |
Output is correct |
80 |
Correct |
3 ms |
4188 KB |
Output is correct |
81 |
Correct |
2 ms |
2652 KB |
Output is correct |
82 |
Correct |
2 ms |
3164 KB |
Output is correct |
83 |
Correct |
1 ms |
604 KB |
Output is correct |
84 |
Correct |
2 ms |
604 KB |
Output is correct |
85 |
Correct |
7 ms |
1628 KB |
Output is correct |
86 |
Correct |
3 ms |
680 KB |
Output is correct |
87 |
Correct |
4 ms |
884 KB |
Output is correct |
88 |
Correct |
5 ms |
888 KB |
Output is correct |
89 |
Correct |
97 ms |
141892 KB |
Output is correct |
90 |
Correct |
77 ms |
116428 KB |
Output is correct |
91 |
Correct |
93 ms |
140680 KB |
Output is correct |
92 |
Correct |
82 ms |
122204 KB |
Output is correct |
93 |
Correct |
82 ms |
124680 KB |
Output is correct |
94 |
Correct |
74 ms |
128700 KB |
Output is correct |
95 |
Correct |
76 ms |
134992 KB |
Output is correct |
96 |
Correct |
71 ms |
118096 KB |
Output is correct |
97 |
Correct |
88 ms |
134224 KB |
Output is correct |
98 |
Correct |
89 ms |
130504 KB |
Output is correct |
99 |
Correct |
96 ms |
141908 KB |
Output is correct |
100 |
Correct |
51 ms |
68696 KB |
Output is correct |
101 |
Correct |
12 ms |
4316 KB |
Output is correct |
102 |
Correct |
159 ms |
5720 KB |
Output is correct |
103 |
Correct |
662 ms |
8280 KB |
Output is correct |
104 |
Execution timed out |
1135 ms |
1667392 KB |
Time limit exceeded |
105 |
Halted |
0 ms |
0 KB |
- |