#include "closing.h"
#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
using namespace std;
const int MAXN=200010;
vector<pair<int,int>> g[MAXN];
long long distX[MAXN], distY[MAXN];
int dd[MAXN];
vector<int> path;
long long dist=0;
void dfsx(int at, int p) {
for(auto [to,w]:g[at]) {
if(to==p)continue;
distX[to]=distX[at]+w;
dfsx(to, at);
}
}
void dfsy(int at, int p) {
for(auto [to,w]:g[at]) {
if(to==p)continue;
distY[to]=distY[at]+w;
dfsy(to, at);
if(dd[to])dist+=w;
dd[at]|=dd[to];
}
if(dd[at])path.push_back(at);
}
int max_score(int N, int X, int Y, long long K,
std::vector<int> U, std::vector<int> V, std::vector<int> W)
{
for(int i = 0;i<N-1;i++) {
g[U[i]].push_back({V[i], W[i]});
g[V[i]].push_back({U[i], W[i]});
}
dist=0;
dd[X]=1;
dfsx(X, -1);
dfsy(Y, -1);
int ans=0;
// case 1
{
int cnt=0;
priority_queue<long long> pq;
for(int i = 0;i<N;i++) {
pq.push(-distX[i]);
pq.push(-distY[i]);
}
long long sum=0;
while(sum<=K and pq.size()) {
sum-=pq.top();
cnt++;
pq.pop();
if(sum<=K)ans=max(ans,cnt);
}
}
// case 2
if(2*K>=dist){
for(int i = 0;i<N;i++) {
if(distX[i]>distY[i])swap(distX[i], distY[i]);
}
int upd[N];
memset(upd, 0, sizeof upd);
for(int i:path) {
upd[i]++;
}
vector<vector<long long>> dp(N+1, vector<long long> (2*N+1));
for(int i = 0;i<=N;i++)
for(int j = 0;j<=2*N;j++)
dp[i][j]=1e18;
dp[0][0]=0;
for(int i = 1;i<=N;i++) {
if(upd[i-1]==0) {
for(int j = 0;j<=2*N;j++){
dp[i][j]=dp[i-1][j];
}
}
for(int j = 1;j<=2*N;j++) {
dp[i][j]=min(dp[i][j], dp[i-1][j-1]+distX[i-1]);
}
for(int j = 2;j<=2*N;j++) {
dp[i][j]=min(dp[i][j], dp[i-1][j-2]+distY[i-1]);
}
}
for(int j = 0;j<=2*N;j++) {
if(dp[N][j]<=K){
ans=max(ans,j);
}
}
}
for(int i = 0;i<=N;i++) {
dd[i]=0;
distX[i]=distY[i]=0;
g[i].clear();
}
path.clear();
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
7000 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
106 ms |
32436 KB |
Output is correct |
2 |
Correct |
108 ms |
38356 KB |
Output is correct |
3 |
Correct |
55 ms |
9660 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
6748 KB |
Output is correct |
2 |
Correct |
1 ms |
6748 KB |
Output is correct |
3 |
Correct |
2 ms |
6748 KB |
Output is correct |
4 |
Correct |
2 ms |
6748 KB |
Output is correct |
5 |
Correct |
2 ms |
6748 KB |
Output is correct |
6 |
Correct |
1 ms |
6748 KB |
Output is correct |
7 |
Correct |
1 ms |
6748 KB |
Output is correct |
8 |
Correct |
2 ms |
6832 KB |
Output is correct |
9 |
Correct |
2 ms |
6748 KB |
Output is correct |
10 |
Correct |
2 ms |
6748 KB |
Output is correct |
11 |
Correct |
2 ms |
6748 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
6748 KB |
Output is correct |
2 |
Correct |
1 ms |
6748 KB |
Output is correct |
3 |
Correct |
2 ms |
6748 KB |
Output is correct |
4 |
Correct |
2 ms |
6748 KB |
Output is correct |
5 |
Correct |
2 ms |
6748 KB |
Output is correct |
6 |
Correct |
1 ms |
6748 KB |
Output is correct |
7 |
Correct |
1 ms |
6748 KB |
Output is correct |
8 |
Correct |
2 ms |
6832 KB |
Output is correct |
9 |
Correct |
2 ms |
6748 KB |
Output is correct |
10 |
Correct |
2 ms |
6748 KB |
Output is correct |
11 |
Correct |
2 ms |
6748 KB |
Output is correct |
12 |
Correct |
2 ms |
7000 KB |
Output is correct |
13 |
Correct |
2 ms |
7004 KB |
Output is correct |
14 |
Correct |
2 ms |
6748 KB |
Output is correct |
15 |
Correct |
2 ms |
6748 KB |
Output is correct |
16 |
Correct |
2 ms |
7004 KB |
Output is correct |
17 |
Correct |
2 ms |
7000 KB |
Output is correct |
18 |
Correct |
2 ms |
6748 KB |
Output is correct |
19 |
Correct |
5 ms |
10844 KB |
Output is correct |
20 |
Correct |
4 ms |
10072 KB |
Output is correct |
21 |
Correct |
4 ms |
10328 KB |
Output is correct |
22 |
Correct |
5 ms |
10588 KB |
Output is correct |
23 |
Correct |
5 ms |
10844 KB |
Output is correct |
24 |
Correct |
4 ms |
10844 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
6748 KB |
Output is correct |
2 |
Correct |
1 ms |
6748 KB |
Output is correct |
3 |
Correct |
2 ms |
6748 KB |
Output is correct |
4 |
Correct |
2 ms |
6748 KB |
Output is correct |
5 |
Correct |
2 ms |
6748 KB |
Output is correct |
6 |
Correct |
1 ms |
6748 KB |
Output is correct |
7 |
Correct |
1 ms |
6748 KB |
Output is correct |
8 |
Correct |
2 ms |
6832 KB |
Output is correct |
9 |
Correct |
2 ms |
6748 KB |
Output is correct |
10 |
Correct |
2 ms |
6748 KB |
Output is correct |
11 |
Correct |
2 ms |
6748 KB |
Output is correct |
12 |
Correct |
2 ms |
7000 KB |
Output is correct |
13 |
Correct |
2 ms |
7004 KB |
Output is correct |
14 |
Correct |
2 ms |
6748 KB |
Output is correct |
15 |
Correct |
2 ms |
6748 KB |
Output is correct |
16 |
Correct |
2 ms |
7004 KB |
Output is correct |
17 |
Correct |
2 ms |
7000 KB |
Output is correct |
18 |
Correct |
2 ms |
6748 KB |
Output is correct |
19 |
Correct |
5 ms |
10844 KB |
Output is correct |
20 |
Correct |
4 ms |
10072 KB |
Output is correct |
21 |
Correct |
4 ms |
10328 KB |
Output is correct |
22 |
Correct |
5 ms |
10588 KB |
Output is correct |
23 |
Correct |
5 ms |
10844 KB |
Output is correct |
24 |
Correct |
4 ms |
10844 KB |
Output is correct |
25 |
Correct |
5 ms |
6744 KB |
Output is correct |
26 |
Correct |
119 ms |
148280 KB |
Output is correct |
27 |
Correct |
101 ms |
129048 KB |
Output is correct |
28 |
Correct |
96 ms |
130888 KB |
Output is correct |
29 |
Correct |
106 ms |
140884 KB |
Output is correct |
30 |
Correct |
110 ms |
127912 KB |
Output is correct |
31 |
Correct |
110 ms |
148244 KB |
Output is correct |
32 |
Correct |
107 ms |
148304 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
7000 KB |
Output is correct |
2 |
Correct |
2 ms |
6748 KB |
Output is correct |
3 |
Correct |
1 ms |
6748 KB |
Output is correct |
4 |
Correct |
2 ms |
6748 KB |
Output is correct |
5 |
Correct |
2 ms |
6748 KB |
Output is correct |
6 |
Correct |
2 ms |
6748 KB |
Output is correct |
7 |
Correct |
2 ms |
6744 KB |
Output is correct |
8 |
Correct |
2 ms |
6748 KB |
Output is correct |
9 |
Correct |
2 ms |
6748 KB |
Output is correct |
10 |
Correct |
1 ms |
6748 KB |
Output is correct |
11 |
Correct |
2 ms |
6748 KB |
Output is correct |
12 |
Correct |
2 ms |
6748 KB |
Output is correct |
13 |
Correct |
2 ms |
6748 KB |
Output is correct |
14 |
Correct |
1 ms |
6748 KB |
Output is correct |
15 |
Correct |
2 ms |
6748 KB |
Output is correct |
16 |
Correct |
2 ms |
6744 KB |
Output is correct |
17 |
Correct |
1 ms |
6748 KB |
Output is correct |
18 |
Correct |
2 ms |
6748 KB |
Output is correct |
19 |
Correct |
2 ms |
6744 KB |
Output is correct |
20 |
Correct |
2 ms |
6748 KB |
Output is correct |
21 |
Correct |
1 ms |
6748 KB |
Output is correct |
22 |
Correct |
1 ms |
6748 KB |
Output is correct |
23 |
Correct |
1 ms |
6744 KB |
Output is correct |
24 |
Correct |
2 ms |
6744 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
7000 KB |
Output is correct |
2 |
Correct |
2 ms |
6748 KB |
Output is correct |
3 |
Correct |
1 ms |
6748 KB |
Output is correct |
4 |
Correct |
2 ms |
6748 KB |
Output is correct |
5 |
Correct |
2 ms |
6748 KB |
Output is correct |
6 |
Correct |
2 ms |
6748 KB |
Output is correct |
7 |
Correct |
1 ms |
6748 KB |
Output is correct |
8 |
Correct |
1 ms |
6748 KB |
Output is correct |
9 |
Correct |
2 ms |
6832 KB |
Output is correct |
10 |
Correct |
2 ms |
6748 KB |
Output is correct |
11 |
Correct |
2 ms |
6748 KB |
Output is correct |
12 |
Correct |
2 ms |
6748 KB |
Output is correct |
13 |
Correct |
2 ms |
7000 KB |
Output is correct |
14 |
Correct |
2 ms |
7004 KB |
Output is correct |
15 |
Correct |
2 ms |
6748 KB |
Output is correct |
16 |
Correct |
2 ms |
6748 KB |
Output is correct |
17 |
Correct |
2 ms |
7004 KB |
Output is correct |
18 |
Correct |
2 ms |
7000 KB |
Output is correct |
19 |
Correct |
2 ms |
6744 KB |
Output is correct |
20 |
Correct |
2 ms |
6748 KB |
Output is correct |
21 |
Correct |
2 ms |
6748 KB |
Output is correct |
22 |
Correct |
1 ms |
6748 KB |
Output is correct |
23 |
Correct |
2 ms |
6748 KB |
Output is correct |
24 |
Correct |
2 ms |
6748 KB |
Output is correct |
25 |
Correct |
2 ms |
6748 KB |
Output is correct |
26 |
Correct |
1 ms |
6748 KB |
Output is correct |
27 |
Correct |
2 ms |
6748 KB |
Output is correct |
28 |
Correct |
2 ms |
6744 KB |
Output is correct |
29 |
Correct |
1 ms |
6748 KB |
Output is correct |
30 |
Correct |
2 ms |
6748 KB |
Output is correct |
31 |
Correct |
2 ms |
6744 KB |
Output is correct |
32 |
Correct |
2 ms |
6748 KB |
Output is correct |
33 |
Correct |
1 ms |
6748 KB |
Output is correct |
34 |
Correct |
1 ms |
6748 KB |
Output is correct |
35 |
Correct |
1 ms |
6744 KB |
Output is correct |
36 |
Correct |
2 ms |
6744 KB |
Output is correct |
37 |
Correct |
2 ms |
7156 KB |
Output is correct |
38 |
Correct |
2 ms |
6748 KB |
Output is correct |
39 |
Correct |
2 ms |
7004 KB |
Output is correct |
40 |
Correct |
2 ms |
6748 KB |
Output is correct |
41 |
Correct |
1 ms |
6968 KB |
Output is correct |
42 |
Correct |
2 ms |
6748 KB |
Output is correct |
43 |
Correct |
2 ms |
6752 KB |
Output is correct |
44 |
Correct |
2 ms |
6744 KB |
Output is correct |
45 |
Correct |
2 ms |
6968 KB |
Output is correct |
46 |
Correct |
2 ms |
6748 KB |
Output is correct |
47 |
Correct |
2 ms |
6748 KB |
Output is correct |
48 |
Correct |
2 ms |
6744 KB |
Output is correct |
49 |
Correct |
1 ms |
6748 KB |
Output is correct |
50 |
Correct |
2 ms |
6748 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
7000 KB |
Output is correct |
2 |
Correct |
2 ms |
6748 KB |
Output is correct |
3 |
Correct |
1 ms |
6748 KB |
Output is correct |
4 |
Correct |
2 ms |
6748 KB |
Output is correct |
5 |
Correct |
2 ms |
6748 KB |
Output is correct |
6 |
Correct |
2 ms |
6748 KB |
Output is correct |
7 |
Correct |
1 ms |
6748 KB |
Output is correct |
8 |
Correct |
1 ms |
6748 KB |
Output is correct |
9 |
Correct |
2 ms |
6832 KB |
Output is correct |
10 |
Correct |
2 ms |
6748 KB |
Output is correct |
11 |
Correct |
2 ms |
6748 KB |
Output is correct |
12 |
Correct |
2 ms |
6748 KB |
Output is correct |
13 |
Correct |
2 ms |
7000 KB |
Output is correct |
14 |
Correct |
2 ms |
7004 KB |
Output is correct |
15 |
Correct |
2 ms |
6748 KB |
Output is correct |
16 |
Correct |
2 ms |
6748 KB |
Output is correct |
17 |
Correct |
2 ms |
7004 KB |
Output is correct |
18 |
Correct |
2 ms |
7000 KB |
Output is correct |
19 |
Correct |
2 ms |
6748 KB |
Output is correct |
20 |
Correct |
5 ms |
10844 KB |
Output is correct |
21 |
Correct |
4 ms |
10072 KB |
Output is correct |
22 |
Correct |
4 ms |
10328 KB |
Output is correct |
23 |
Correct |
5 ms |
10588 KB |
Output is correct |
24 |
Correct |
5 ms |
10844 KB |
Output is correct |
25 |
Correct |
4 ms |
10844 KB |
Output is correct |
26 |
Correct |
2 ms |
6744 KB |
Output is correct |
27 |
Correct |
2 ms |
6748 KB |
Output is correct |
28 |
Correct |
2 ms |
6748 KB |
Output is correct |
29 |
Correct |
1 ms |
6748 KB |
Output is correct |
30 |
Correct |
2 ms |
6748 KB |
Output is correct |
31 |
Correct |
2 ms |
6748 KB |
Output is correct |
32 |
Correct |
2 ms |
6748 KB |
Output is correct |
33 |
Correct |
1 ms |
6748 KB |
Output is correct |
34 |
Correct |
2 ms |
6748 KB |
Output is correct |
35 |
Correct |
2 ms |
6744 KB |
Output is correct |
36 |
Correct |
1 ms |
6748 KB |
Output is correct |
37 |
Correct |
2 ms |
6748 KB |
Output is correct |
38 |
Correct |
2 ms |
6744 KB |
Output is correct |
39 |
Correct |
2 ms |
6748 KB |
Output is correct |
40 |
Correct |
1 ms |
6748 KB |
Output is correct |
41 |
Correct |
1 ms |
6748 KB |
Output is correct |
42 |
Correct |
1 ms |
6744 KB |
Output is correct |
43 |
Correct |
2 ms |
6744 KB |
Output is correct |
44 |
Correct |
2 ms |
7156 KB |
Output is correct |
45 |
Correct |
2 ms |
6748 KB |
Output is correct |
46 |
Correct |
2 ms |
7004 KB |
Output is correct |
47 |
Correct |
2 ms |
6748 KB |
Output is correct |
48 |
Correct |
1 ms |
6968 KB |
Output is correct |
49 |
Correct |
2 ms |
6748 KB |
Output is correct |
50 |
Correct |
2 ms |
6752 KB |
Output is correct |
51 |
Correct |
2 ms |
6744 KB |
Output is correct |
52 |
Correct |
2 ms |
6968 KB |
Output is correct |
53 |
Correct |
2 ms |
6748 KB |
Output is correct |
54 |
Correct |
2 ms |
6748 KB |
Output is correct |
55 |
Correct |
2 ms |
6744 KB |
Output is correct |
56 |
Correct |
1 ms |
6748 KB |
Output is correct |
57 |
Correct |
2 ms |
6748 KB |
Output is correct |
58 |
Correct |
2 ms |
6748 KB |
Output is correct |
59 |
Correct |
2 ms |
6980 KB |
Output is correct |
60 |
Correct |
2 ms |
7004 KB |
Output is correct |
61 |
Correct |
2 ms |
7048 KB |
Output is correct |
62 |
Correct |
3 ms |
7052 KB |
Output is correct |
63 |
Correct |
4 ms |
10588 KB |
Output is correct |
64 |
Correct |
4 ms |
10076 KB |
Output is correct |
65 |
Correct |
4 ms |
10076 KB |
Output is correct |
66 |
Correct |
4 ms |
10332 KB |
Output is correct |
67 |
Correct |
4 ms |
10588 KB |
Output is correct |
68 |
Correct |
4 ms |
9972 KB |
Output is correct |
69 |
Correct |
4 ms |
10584 KB |
Output is correct |
70 |
Correct |
4 ms |
10332 KB |
Output is correct |
71 |
Correct |
4 ms |
10332 KB |
Output is correct |
72 |
Correct |
4 ms |
10332 KB |
Output is correct |
73 |
Correct |
3 ms |
9052 KB |
Output is correct |
74 |
Correct |
4 ms |
9308 KB |
Output is correct |
75 |
Correct |
2 ms |
7004 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
7000 KB |
Output is correct |
2 |
Correct |
2 ms |
6748 KB |
Output is correct |
3 |
Correct |
1 ms |
6748 KB |
Output is correct |
4 |
Correct |
2 ms |
6748 KB |
Output is correct |
5 |
Correct |
2 ms |
6748 KB |
Output is correct |
6 |
Correct |
2 ms |
6748 KB |
Output is correct |
7 |
Correct |
1 ms |
6748 KB |
Output is correct |
8 |
Correct |
1 ms |
6748 KB |
Output is correct |
9 |
Correct |
2 ms |
6832 KB |
Output is correct |
10 |
Correct |
2 ms |
6748 KB |
Output is correct |
11 |
Correct |
2 ms |
6748 KB |
Output is correct |
12 |
Correct |
2 ms |
6748 KB |
Output is correct |
13 |
Correct |
2 ms |
7000 KB |
Output is correct |
14 |
Correct |
2 ms |
7004 KB |
Output is correct |
15 |
Correct |
2 ms |
6748 KB |
Output is correct |
16 |
Correct |
2 ms |
6748 KB |
Output is correct |
17 |
Correct |
2 ms |
7004 KB |
Output is correct |
18 |
Correct |
2 ms |
7000 KB |
Output is correct |
19 |
Correct |
2 ms |
6748 KB |
Output is correct |
20 |
Correct |
5 ms |
10844 KB |
Output is correct |
21 |
Correct |
4 ms |
10072 KB |
Output is correct |
22 |
Correct |
4 ms |
10328 KB |
Output is correct |
23 |
Correct |
5 ms |
10588 KB |
Output is correct |
24 |
Correct |
5 ms |
10844 KB |
Output is correct |
25 |
Correct |
4 ms |
10844 KB |
Output is correct |
26 |
Correct |
5 ms |
6744 KB |
Output is correct |
27 |
Correct |
119 ms |
148280 KB |
Output is correct |
28 |
Correct |
101 ms |
129048 KB |
Output is correct |
29 |
Correct |
96 ms |
130888 KB |
Output is correct |
30 |
Correct |
106 ms |
140884 KB |
Output is correct |
31 |
Correct |
110 ms |
127912 KB |
Output is correct |
32 |
Correct |
110 ms |
148244 KB |
Output is correct |
33 |
Correct |
107 ms |
148304 KB |
Output is correct |
34 |
Correct |
2 ms |
6744 KB |
Output is correct |
35 |
Correct |
2 ms |
6748 KB |
Output is correct |
36 |
Correct |
2 ms |
6748 KB |
Output is correct |
37 |
Correct |
1 ms |
6748 KB |
Output is correct |
38 |
Correct |
2 ms |
6748 KB |
Output is correct |
39 |
Correct |
2 ms |
6748 KB |
Output is correct |
40 |
Correct |
2 ms |
6748 KB |
Output is correct |
41 |
Correct |
1 ms |
6748 KB |
Output is correct |
42 |
Correct |
2 ms |
6748 KB |
Output is correct |
43 |
Correct |
2 ms |
6744 KB |
Output is correct |
44 |
Correct |
1 ms |
6748 KB |
Output is correct |
45 |
Correct |
2 ms |
6748 KB |
Output is correct |
46 |
Correct |
2 ms |
6744 KB |
Output is correct |
47 |
Correct |
2 ms |
6748 KB |
Output is correct |
48 |
Correct |
1 ms |
6748 KB |
Output is correct |
49 |
Correct |
1 ms |
6748 KB |
Output is correct |
50 |
Correct |
1 ms |
6744 KB |
Output is correct |
51 |
Correct |
2 ms |
6744 KB |
Output is correct |
52 |
Correct |
2 ms |
7156 KB |
Output is correct |
53 |
Correct |
2 ms |
6748 KB |
Output is correct |
54 |
Correct |
2 ms |
7004 KB |
Output is correct |
55 |
Correct |
2 ms |
6748 KB |
Output is correct |
56 |
Correct |
1 ms |
6968 KB |
Output is correct |
57 |
Correct |
2 ms |
6748 KB |
Output is correct |
58 |
Correct |
2 ms |
6752 KB |
Output is correct |
59 |
Correct |
2 ms |
6744 KB |
Output is correct |
60 |
Correct |
2 ms |
6968 KB |
Output is correct |
61 |
Correct |
2 ms |
6748 KB |
Output is correct |
62 |
Correct |
2 ms |
6748 KB |
Output is correct |
63 |
Correct |
2 ms |
6744 KB |
Output is correct |
64 |
Correct |
1 ms |
6748 KB |
Output is correct |
65 |
Correct |
2 ms |
6748 KB |
Output is correct |
66 |
Correct |
2 ms |
6748 KB |
Output is correct |
67 |
Correct |
2 ms |
6980 KB |
Output is correct |
68 |
Correct |
2 ms |
7004 KB |
Output is correct |
69 |
Correct |
2 ms |
7048 KB |
Output is correct |
70 |
Correct |
3 ms |
7052 KB |
Output is correct |
71 |
Correct |
4 ms |
10588 KB |
Output is correct |
72 |
Correct |
4 ms |
10076 KB |
Output is correct |
73 |
Correct |
4 ms |
10076 KB |
Output is correct |
74 |
Correct |
4 ms |
10332 KB |
Output is correct |
75 |
Correct |
4 ms |
10588 KB |
Output is correct |
76 |
Correct |
4 ms |
9972 KB |
Output is correct |
77 |
Correct |
4 ms |
10584 KB |
Output is correct |
78 |
Correct |
4 ms |
10332 KB |
Output is correct |
79 |
Correct |
4 ms |
10332 KB |
Output is correct |
80 |
Correct |
4 ms |
10332 KB |
Output is correct |
81 |
Correct |
3 ms |
9052 KB |
Output is correct |
82 |
Correct |
4 ms |
9308 KB |
Output is correct |
83 |
Correct |
2 ms |
7004 KB |
Output is correct |
84 |
Correct |
3 ms |
6744 KB |
Output is correct |
85 |
Correct |
9 ms |
8028 KB |
Output is correct |
86 |
Correct |
5 ms |
7036 KB |
Output is correct |
87 |
Correct |
6 ms |
7240 KB |
Output is correct |
88 |
Correct |
7 ms |
7244 KB |
Output is correct |
89 |
Correct |
120 ms |
148052 KB |
Output is correct |
90 |
Correct |
97 ms |
122460 KB |
Output is correct |
91 |
Correct |
117 ms |
146832 KB |
Output is correct |
92 |
Correct |
103 ms |
128344 KB |
Output is correct |
93 |
Correct |
109 ms |
131156 KB |
Output is correct |
94 |
Correct |
98 ms |
134736 KB |
Output is correct |
95 |
Correct |
110 ms |
141588 KB |
Output is correct |
96 |
Correct |
94 ms |
124208 KB |
Output is correct |
97 |
Correct |
108 ms |
140608 KB |
Output is correct |
98 |
Correct |
106 ms |
136884 KB |
Output is correct |
99 |
Correct |
117 ms |
148080 KB |
Output is correct |
100 |
Correct |
62 ms |
75188 KB |
Output is correct |
101 |
Correct |
13 ms |
10736 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
7000 KB |
Output is correct |
2 |
Correct |
2 ms |
6748 KB |
Output is correct |
3 |
Correct |
1 ms |
6748 KB |
Output is correct |
4 |
Correct |
2 ms |
6748 KB |
Output is correct |
5 |
Correct |
2 ms |
6748 KB |
Output is correct |
6 |
Correct |
2 ms |
6748 KB |
Output is correct |
7 |
Correct |
1 ms |
6748 KB |
Output is correct |
8 |
Correct |
1 ms |
6748 KB |
Output is correct |
9 |
Correct |
2 ms |
6832 KB |
Output is correct |
10 |
Correct |
2 ms |
6748 KB |
Output is correct |
11 |
Correct |
2 ms |
6748 KB |
Output is correct |
12 |
Correct |
2 ms |
6748 KB |
Output is correct |
13 |
Correct |
2 ms |
7000 KB |
Output is correct |
14 |
Correct |
2 ms |
7004 KB |
Output is correct |
15 |
Correct |
2 ms |
6748 KB |
Output is correct |
16 |
Correct |
2 ms |
6748 KB |
Output is correct |
17 |
Correct |
2 ms |
7004 KB |
Output is correct |
18 |
Correct |
2 ms |
7000 KB |
Output is correct |
19 |
Correct |
2 ms |
6748 KB |
Output is correct |
20 |
Correct |
5 ms |
10844 KB |
Output is correct |
21 |
Correct |
4 ms |
10072 KB |
Output is correct |
22 |
Correct |
4 ms |
10328 KB |
Output is correct |
23 |
Correct |
5 ms |
10588 KB |
Output is correct |
24 |
Correct |
5 ms |
10844 KB |
Output is correct |
25 |
Correct |
4 ms |
10844 KB |
Output is correct |
26 |
Correct |
5 ms |
6744 KB |
Output is correct |
27 |
Correct |
119 ms |
148280 KB |
Output is correct |
28 |
Correct |
101 ms |
129048 KB |
Output is correct |
29 |
Correct |
96 ms |
130888 KB |
Output is correct |
30 |
Correct |
106 ms |
140884 KB |
Output is correct |
31 |
Correct |
110 ms |
127912 KB |
Output is correct |
32 |
Correct |
110 ms |
148244 KB |
Output is correct |
33 |
Correct |
107 ms |
148304 KB |
Output is correct |
34 |
Correct |
2 ms |
6744 KB |
Output is correct |
35 |
Correct |
2 ms |
6748 KB |
Output is correct |
36 |
Correct |
2 ms |
6748 KB |
Output is correct |
37 |
Correct |
1 ms |
6748 KB |
Output is correct |
38 |
Correct |
2 ms |
6748 KB |
Output is correct |
39 |
Correct |
2 ms |
6748 KB |
Output is correct |
40 |
Correct |
2 ms |
6748 KB |
Output is correct |
41 |
Correct |
1 ms |
6748 KB |
Output is correct |
42 |
Correct |
2 ms |
6748 KB |
Output is correct |
43 |
Correct |
2 ms |
6744 KB |
Output is correct |
44 |
Correct |
1 ms |
6748 KB |
Output is correct |
45 |
Correct |
2 ms |
6748 KB |
Output is correct |
46 |
Correct |
2 ms |
6744 KB |
Output is correct |
47 |
Correct |
2 ms |
6748 KB |
Output is correct |
48 |
Correct |
1 ms |
6748 KB |
Output is correct |
49 |
Correct |
1 ms |
6748 KB |
Output is correct |
50 |
Correct |
1 ms |
6744 KB |
Output is correct |
51 |
Correct |
2 ms |
6744 KB |
Output is correct |
52 |
Correct |
2 ms |
7156 KB |
Output is correct |
53 |
Correct |
2 ms |
6748 KB |
Output is correct |
54 |
Correct |
2 ms |
7004 KB |
Output is correct |
55 |
Correct |
2 ms |
6748 KB |
Output is correct |
56 |
Correct |
1 ms |
6968 KB |
Output is correct |
57 |
Correct |
2 ms |
6748 KB |
Output is correct |
58 |
Correct |
2 ms |
6752 KB |
Output is correct |
59 |
Correct |
2 ms |
6744 KB |
Output is correct |
60 |
Correct |
2 ms |
6968 KB |
Output is correct |
61 |
Correct |
2 ms |
6748 KB |
Output is correct |
62 |
Correct |
2 ms |
6748 KB |
Output is correct |
63 |
Correct |
2 ms |
6744 KB |
Output is correct |
64 |
Correct |
1 ms |
6748 KB |
Output is correct |
65 |
Correct |
2 ms |
6748 KB |
Output is correct |
66 |
Correct |
2 ms |
6748 KB |
Output is correct |
67 |
Correct |
2 ms |
6980 KB |
Output is correct |
68 |
Correct |
2 ms |
7004 KB |
Output is correct |
69 |
Correct |
2 ms |
7048 KB |
Output is correct |
70 |
Correct |
3 ms |
7052 KB |
Output is correct |
71 |
Correct |
4 ms |
10588 KB |
Output is correct |
72 |
Correct |
4 ms |
10076 KB |
Output is correct |
73 |
Correct |
4 ms |
10076 KB |
Output is correct |
74 |
Correct |
4 ms |
10332 KB |
Output is correct |
75 |
Correct |
4 ms |
10588 KB |
Output is correct |
76 |
Correct |
4 ms |
9972 KB |
Output is correct |
77 |
Correct |
4 ms |
10584 KB |
Output is correct |
78 |
Correct |
4 ms |
10332 KB |
Output is correct |
79 |
Correct |
4 ms |
10332 KB |
Output is correct |
80 |
Correct |
4 ms |
10332 KB |
Output is correct |
81 |
Correct |
3 ms |
9052 KB |
Output is correct |
82 |
Correct |
4 ms |
9308 KB |
Output is correct |
83 |
Correct |
2 ms |
7004 KB |
Output is correct |
84 |
Correct |
3 ms |
6744 KB |
Output is correct |
85 |
Correct |
9 ms |
8028 KB |
Output is correct |
86 |
Correct |
5 ms |
7036 KB |
Output is correct |
87 |
Correct |
6 ms |
7240 KB |
Output is correct |
88 |
Correct |
7 ms |
7244 KB |
Output is correct |
89 |
Correct |
120 ms |
148052 KB |
Output is correct |
90 |
Correct |
97 ms |
122460 KB |
Output is correct |
91 |
Correct |
117 ms |
146832 KB |
Output is correct |
92 |
Correct |
103 ms |
128344 KB |
Output is correct |
93 |
Correct |
109 ms |
131156 KB |
Output is correct |
94 |
Correct |
98 ms |
134736 KB |
Output is correct |
95 |
Correct |
110 ms |
141588 KB |
Output is correct |
96 |
Correct |
94 ms |
124208 KB |
Output is correct |
97 |
Correct |
108 ms |
140608 KB |
Output is correct |
98 |
Correct |
106 ms |
136884 KB |
Output is correct |
99 |
Correct |
117 ms |
148080 KB |
Output is correct |
100 |
Correct |
62 ms |
75188 KB |
Output is correct |
101 |
Correct |
13 ms |
10736 KB |
Output is correct |
102 |
Correct |
173 ms |
9620 KB |
Output is correct |
103 |
Correct |
700 ms |
11848 KB |
Output is correct |
104 |
Execution timed out |
1106 ms |
1903644 KB |
Time limit exceeded |
105 |
Halted |
0 ms |
0 KB |
- |