#include "closing.h"
#include <bits/stdc++.h>
using namespace std;
const int maxn=200005;
const int maxs=3005;
#define pii pair<long long,long long>
#define piii pair<long long,pii>
#define fi first
#define se second
const long long inf=2e18;
long long dist[maxn][2];
long long dp2[maxs][2*maxs],dp1[maxs][maxs],nw2[2*maxs],nw1[maxs];
int sz[maxn];
vector<pii> edge[maxn];
bool check[maxn];
bool cc[maxn][2];
int max_score(int n, int X, int Y, long long K,
vector<int> U, vector<int> V, vector<int> W)
{
for(int i=0;i<n;i++){
edge[i].clear();check[i]=cc[i][0]=cc[i][1]=false;
dist[i][0]=dist[i][1]=0;sz[i]=1;
}
for(int i=0;i<n-1;i++){
edge[U[i]].push_back({V[i],W[i]});
edge[V[i]].push_back({U[i],W[i]});
}
vector<int> path;
function<void(int,int)> pre_dfs = [&](int u,int p){
if(u==Y){
path.push_back(u);
check[u]=true;
return;
}
for(auto &[v,w]:edge[u]){
if(v==p) continue;
pre_dfs(v,u);check[u]|=check[v];
}
if(check[u]) path.push_back(u);
};
pre_dfs(X,-1);
reverse(path.begin(),path.end());
function<void(int,int,int)> dfs_dist = [&](int u,int p,int t){
for(auto &[v,w]:edge[u]){
if(v==p) continue;
dist[v][t]=dist[u][t]+w;
dfs_dist(v,u,t);
}
};
dfs_dist(X,-1,0);dfs_dist(Y,-1,1);
long long res=0,sum=0;
priority_queue<piii,vector<piii>,greater<piii>> pq;
pq.push({0,{X,0}});pq.push({0,{Y,1}});
while(!pq.empty()){
long long d=pq.top().fi;
int u=pq.top().se.fi,t=pq.top().se.se;pq.pop();
if(sum+d>K) break;
sum+=d;res++;cc[u][t]=true;
for(auto &[v,w]:edge[u]){
if(!cc[v][t]) pq.push({dist[v][t],{v,t}});
}
}
if(n<=3000){
priority_queue<long long,vector<long long>,greater<long long>> pq2;
function<void(int,int)> dfs = [&](int u,int p){
pq2.push(min(dist[u][0],dist[u][1]));
for(auto &[v,w]:edge[u]){
if(v==p || check[v]) continue;
dfs(v,u);sz[u]+=sz[v];
}
};
int pos=path[0];
for(int u:path){
dfs(u,-1);
for(int i=0;i<=2*n;i++) dp1[u][i]=dp2[u][i]=inf;
long long d=abs(dist[u][0]-dist[u][1]);
for(int i=1;i<=sz[u];i++) dp1[u][i]=(i==1?0:dp1[u][i-1])+pq2.top(),pq2.pop();
for(int i=sz[u];i>=1;i--){
for(int j=1;j<=i;j++) dp2[u][i+j]=min(dp2[u][i+j],dp1[u][i]+d*j);
}
if(dist[u][0]<=dist[u][1]) pos=u;
/*
cout << u << '\n';
for(int i=1;i<=sz[u];i++) cout << dp1[u][i] << ' ';
cout << '\n';
for(int i=1;i<=2*sz[u];i++) cout << (dp2[u][i]==inf?-1:dp2[u][i]) << ' ';
cout << '\n';
*/
}
function<void(int,int)> unions2 = [&](int u,int v){
for(int i=1;i<=2*(sz[u]+sz[v]);i++) nw2[i]=inf;
for(int i=1;i<=sz[u]+sz[v];i++) nw1[i]=inf;
for(int i=2*sz[u];i>=1;i--){
for(int j=1;j<=2*sz[v];j++){
nw2[i+j]=min(nw2[i+j],dp2[u][i]+dp2[v][j]);
if(j<=sz[v]){
nw2[i+j]=min(nw2[i+j],dp2[u][i]+dp1[v][j]);
if(i<=sz[u]) nw1[i+j]=min(nw1[i+j],dp1[u][i]+dp1[v][j]);
}
}
}
sz[u]+=sz[v];
for(int i=1;i<=2*sz[u];i++) dp2[u][i]=nw2[i];
for(int i=1;i<=sz[u];i++) dp1[u][i]=nw1[i];
};
for(int i=0;i<(int)path.size();i++){
if(i) unions2(path[i],path[i-1]);
if(path[i]==pos) break;
}
//cout << sz[0] << ' ' << sz[1] << '\n';
for(int t=(int)path.size()-1;t>=0;t--){
if(path[t]==pos){
int u=path[t],v=path[t+1];
for(int i=1;i<=2*(sz[u]+sz[v]);i++) nw2[i]=inf;
for(int j=1;j<=sz[u];j++) dp2[u][j]=min(dp2[u][j],dp1[u][j]);
for(int j=1;j<=sz[v];j++) dp2[v][j]=min(dp2[v][j],dp1[v][j]);
/*
for(int i=1;i<=2*sz[u];i++) cout << dp2[u][i] << ' ';
cout << '\n';
for(int i=1;i<=2*sz[v];i++) cout << dp2[v][i] << ' ';
cout << '\n';
*/
for(int i=2*sz[u];i>=1;i--){
for(int j=1;j<=2*sz[v];j++) nw2[i+j]=min(nw2[i+j],dp2[u][i]+dp2[v][j]);
}
sz[u]+=sz[v];
//cout << sz[u] << ' ' << sz[v] << '\n';
for(long long j=1;j<=2*sz[u];j++){
//cout << nw2[j] << ' ';
if(nw2[j]<=K) res=max(res,j);
}
//cout << '\n';
break;
}
if(t!=(int)path.size()-1)unions2(path[t],path[t+1]);
}
}
return res;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
115 ms |
33492 KB |
Output is correct |
2 |
Correct |
144 ms |
43476 KB |
Output is correct |
3 |
Correct |
833 ms |
47244 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
2 ms |
4948 KB |
Output is correct |
3 |
Correct |
2 ms |
4948 KB |
Output is correct |
4 |
Correct |
2 ms |
5204 KB |
Output is correct |
5 |
Correct |
2 ms |
5076 KB |
Output is correct |
6 |
Correct |
2 ms |
4948 KB |
Output is correct |
7 |
Correct |
2 ms |
5076 KB |
Output is correct |
8 |
Correct |
2 ms |
5204 KB |
Output is correct |
9 |
Correct |
2 ms |
5332 KB |
Output is correct |
10 |
Correct |
2 ms |
5460 KB |
Output is correct |
11 |
Correct |
2 ms |
5460 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
2 ms |
4948 KB |
Output is correct |
3 |
Correct |
2 ms |
4948 KB |
Output is correct |
4 |
Correct |
2 ms |
5204 KB |
Output is correct |
5 |
Correct |
2 ms |
5076 KB |
Output is correct |
6 |
Correct |
2 ms |
4948 KB |
Output is correct |
7 |
Correct |
2 ms |
5076 KB |
Output is correct |
8 |
Correct |
2 ms |
5204 KB |
Output is correct |
9 |
Correct |
2 ms |
5332 KB |
Output is correct |
10 |
Correct |
2 ms |
5460 KB |
Output is correct |
11 |
Correct |
2 ms |
5460 KB |
Output is correct |
12 |
Correct |
3 ms |
5076 KB |
Output is correct |
13 |
Correct |
2 ms |
5076 KB |
Output is correct |
14 |
Correct |
3 ms |
5588 KB |
Output is correct |
15 |
Correct |
2 ms |
5204 KB |
Output is correct |
16 |
Correct |
3 ms |
6100 KB |
Output is correct |
17 |
Correct |
3 ms |
6100 KB |
Output is correct |
18 |
Correct |
2 ms |
5204 KB |
Output is correct |
19 |
Correct |
3 ms |
5076 KB |
Output is correct |
20 |
Correct |
2 ms |
5076 KB |
Output is correct |
21 |
Correct |
6 ms |
12372 KB |
Output is correct |
22 |
Correct |
5 ms |
10196 KB |
Output is correct |
23 |
Correct |
8 ms |
16980 KB |
Output is correct |
24 |
Correct |
9 ms |
16980 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
2 ms |
4948 KB |
Output is correct |
3 |
Correct |
2 ms |
4948 KB |
Output is correct |
4 |
Correct |
2 ms |
5204 KB |
Output is correct |
5 |
Correct |
2 ms |
5076 KB |
Output is correct |
6 |
Correct |
2 ms |
4948 KB |
Output is correct |
7 |
Correct |
2 ms |
5076 KB |
Output is correct |
8 |
Correct |
2 ms |
5204 KB |
Output is correct |
9 |
Correct |
2 ms |
5332 KB |
Output is correct |
10 |
Correct |
2 ms |
5460 KB |
Output is correct |
11 |
Correct |
2 ms |
5460 KB |
Output is correct |
12 |
Correct |
3 ms |
5076 KB |
Output is correct |
13 |
Correct |
2 ms |
5076 KB |
Output is correct |
14 |
Correct |
3 ms |
5588 KB |
Output is correct |
15 |
Correct |
2 ms |
5204 KB |
Output is correct |
16 |
Correct |
3 ms |
6100 KB |
Output is correct |
17 |
Correct |
3 ms |
6100 KB |
Output is correct |
18 |
Correct |
2 ms |
5204 KB |
Output is correct |
19 |
Correct |
3 ms |
5076 KB |
Output is correct |
20 |
Correct |
2 ms |
5076 KB |
Output is correct |
21 |
Correct |
6 ms |
12372 KB |
Output is correct |
22 |
Correct |
5 ms |
10196 KB |
Output is correct |
23 |
Correct |
8 ms |
16980 KB |
Output is correct |
24 |
Correct |
9 ms |
16980 KB |
Output is correct |
25 |
Correct |
4 ms |
5460 KB |
Output is correct |
26 |
Correct |
12 ms |
5844 KB |
Output is correct |
27 |
Correct |
12 ms |
5648 KB |
Output is correct |
28 |
Correct |
96 ms |
203688 KB |
Output is correct |
29 |
Correct |
73 ms |
137292 KB |
Output is correct |
30 |
Correct |
29 ms |
40148 KB |
Output is correct |
31 |
Correct |
105 ms |
217420 KB |
Output is correct |
32 |
Correct |
102 ms |
217464 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 KB |
Output is correct |
3 |
Correct |
2 ms |
4948 KB |
Output is correct |
4 |
Correct |
2 ms |
4948 KB |
Output is correct |
5 |
Correct |
2 ms |
5204 KB |
Output is correct |
6 |
Correct |
2 ms |
5076 KB |
Output is correct |
7 |
Correct |
2 ms |
4948 KB |
Output is correct |
8 |
Correct |
2 ms |
4948 KB |
Output is correct |
9 |
Correct |
2 ms |
5076 KB |
Output is correct |
10 |
Correct |
2 ms |
5076 KB |
Output is correct |
11 |
Correct |
2 ms |
5076 KB |
Output is correct |
12 |
Correct |
3 ms |
5076 KB |
Output is correct |
13 |
Correct |
2 ms |
4948 KB |
Output is correct |
14 |
Correct |
2 ms |
5076 KB |
Output is correct |
15 |
Correct |
2 ms |
5076 KB |
Output is correct |
16 |
Correct |
2 ms |
4948 KB |
Output is correct |
17 |
Correct |
2 ms |
5076 KB |
Output is correct |
18 |
Correct |
2 ms |
5076 KB |
Output is correct |
19 |
Correct |
2 ms |
5076 KB |
Output is correct |
20 |
Correct |
3 ms |
5076 KB |
Output is correct |
21 |
Correct |
3 ms |
5076 KB |
Output is correct |
22 |
Correct |
2 ms |
4948 KB |
Output is correct |
23 |
Correct |
2 ms |
4948 KB |
Output is correct |
24 |
Correct |
2 ms |
4948 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 KB |
Output is correct |
3 |
Correct |
2 ms |
4948 KB |
Output is correct |
4 |
Correct |
2 ms |
4948 KB |
Output is correct |
5 |
Correct |
2 ms |
5204 KB |
Output is correct |
6 |
Correct |
2 ms |
5076 KB |
Output is correct |
7 |
Correct |
2 ms |
4948 KB |
Output is correct |
8 |
Correct |
2 ms |
5076 KB |
Output is correct |
9 |
Correct |
2 ms |
5204 KB |
Output is correct |
10 |
Correct |
2 ms |
5332 KB |
Output is correct |
11 |
Correct |
2 ms |
5460 KB |
Output is correct |
12 |
Correct |
2 ms |
5460 KB |
Output is correct |
13 |
Correct |
3 ms |
5076 KB |
Output is correct |
14 |
Correct |
2 ms |
5076 KB |
Output is correct |
15 |
Correct |
3 ms |
5588 KB |
Output is correct |
16 |
Correct |
2 ms |
5204 KB |
Output is correct |
17 |
Correct |
3 ms |
6100 KB |
Output is correct |
18 |
Correct |
3 ms |
6100 KB |
Output is correct |
19 |
Correct |
2 ms |
4948 KB |
Output is correct |
20 |
Correct |
2 ms |
4948 KB |
Output is correct |
21 |
Correct |
2 ms |
5076 KB |
Output is correct |
22 |
Correct |
2 ms |
5076 KB |
Output is correct |
23 |
Correct |
2 ms |
5076 KB |
Output is correct |
24 |
Correct |
3 ms |
5076 KB |
Output is correct |
25 |
Correct |
2 ms |
4948 KB |
Output is correct |
26 |
Correct |
2 ms |
5076 KB |
Output is correct |
27 |
Correct |
2 ms |
5076 KB |
Output is correct |
28 |
Correct |
2 ms |
4948 KB |
Output is correct |
29 |
Correct |
2 ms |
5076 KB |
Output is correct |
30 |
Correct |
2 ms |
5076 KB |
Output is correct |
31 |
Correct |
2 ms |
5076 KB |
Output is correct |
32 |
Correct |
3 ms |
5076 KB |
Output is correct |
33 |
Correct |
3 ms |
5076 KB |
Output is correct |
34 |
Correct |
2 ms |
4948 KB |
Output is correct |
35 |
Correct |
2 ms |
4948 KB |
Output is correct |
36 |
Correct |
2 ms |
4948 KB |
Output is correct |
37 |
Correct |
3 ms |
5096 KB |
Output is correct |
38 |
Correct |
2 ms |
5076 KB |
Output is correct |
39 |
Correct |
2 ms |
5076 KB |
Output is correct |
40 |
Correct |
2 ms |
5076 KB |
Output is correct |
41 |
Correct |
2 ms |
5076 KB |
Output is correct |
42 |
Correct |
2 ms |
5076 KB |
Output is correct |
43 |
Correct |
3 ms |
5972 KB |
Output is correct |
44 |
Correct |
2 ms |
5204 KB |
Output is correct |
45 |
Correct |
3 ms |
5460 KB |
Output is correct |
46 |
Correct |
2 ms |
5204 KB |
Output is correct |
47 |
Correct |
2 ms |
5076 KB |
Output is correct |
48 |
Correct |
2 ms |
5076 KB |
Output is correct |
49 |
Correct |
2 ms |
5076 KB |
Output is correct |
50 |
Correct |
2 ms |
5076 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 KB |
Output is correct |
3 |
Correct |
2 ms |
4948 KB |
Output is correct |
4 |
Correct |
2 ms |
4948 KB |
Output is correct |
5 |
Correct |
2 ms |
5204 KB |
Output is correct |
6 |
Correct |
2 ms |
5076 KB |
Output is correct |
7 |
Correct |
2 ms |
4948 KB |
Output is correct |
8 |
Correct |
2 ms |
5076 KB |
Output is correct |
9 |
Correct |
2 ms |
5204 KB |
Output is correct |
10 |
Correct |
2 ms |
5332 KB |
Output is correct |
11 |
Correct |
2 ms |
5460 KB |
Output is correct |
12 |
Correct |
2 ms |
5460 KB |
Output is correct |
13 |
Correct |
3 ms |
5076 KB |
Output is correct |
14 |
Correct |
2 ms |
5076 KB |
Output is correct |
15 |
Correct |
3 ms |
5588 KB |
Output is correct |
16 |
Correct |
2 ms |
5204 KB |
Output is correct |
17 |
Correct |
3 ms |
6100 KB |
Output is correct |
18 |
Correct |
3 ms |
6100 KB |
Output is correct |
19 |
Correct |
2 ms |
5204 KB |
Output is correct |
20 |
Correct |
3 ms |
5076 KB |
Output is correct |
21 |
Correct |
2 ms |
5076 KB |
Output is correct |
22 |
Correct |
6 ms |
12372 KB |
Output is correct |
23 |
Correct |
5 ms |
10196 KB |
Output is correct |
24 |
Correct |
8 ms |
16980 KB |
Output is correct |
25 |
Correct |
9 ms |
16980 KB |
Output is correct |
26 |
Correct |
2 ms |
4948 KB |
Output is correct |
27 |
Correct |
2 ms |
4948 KB |
Output is correct |
28 |
Correct |
2 ms |
5076 KB |
Output is correct |
29 |
Correct |
2 ms |
5076 KB |
Output is correct |
30 |
Correct |
2 ms |
5076 KB |
Output is correct |
31 |
Correct |
3 ms |
5076 KB |
Output is correct |
32 |
Correct |
2 ms |
4948 KB |
Output is correct |
33 |
Correct |
2 ms |
5076 KB |
Output is correct |
34 |
Correct |
2 ms |
5076 KB |
Output is correct |
35 |
Correct |
2 ms |
4948 KB |
Output is correct |
36 |
Correct |
2 ms |
5076 KB |
Output is correct |
37 |
Correct |
2 ms |
5076 KB |
Output is correct |
38 |
Correct |
2 ms |
5076 KB |
Output is correct |
39 |
Correct |
3 ms |
5076 KB |
Output is correct |
40 |
Correct |
3 ms |
5076 KB |
Output is correct |
41 |
Correct |
2 ms |
4948 KB |
Output is correct |
42 |
Correct |
2 ms |
4948 KB |
Output is correct |
43 |
Correct |
2 ms |
4948 KB |
Output is correct |
44 |
Correct |
3 ms |
5096 KB |
Output is correct |
45 |
Correct |
2 ms |
5076 KB |
Output is correct |
46 |
Correct |
2 ms |
5076 KB |
Output is correct |
47 |
Correct |
2 ms |
5076 KB |
Output is correct |
48 |
Correct |
2 ms |
5076 KB |
Output is correct |
49 |
Correct |
2 ms |
5076 KB |
Output is correct |
50 |
Correct |
3 ms |
5972 KB |
Output is correct |
51 |
Correct |
2 ms |
5204 KB |
Output is correct |
52 |
Correct |
3 ms |
5460 KB |
Output is correct |
53 |
Correct |
2 ms |
5204 KB |
Output is correct |
54 |
Correct |
2 ms |
5076 KB |
Output is correct |
55 |
Correct |
2 ms |
5076 KB |
Output is correct |
56 |
Correct |
2 ms |
5076 KB |
Output is correct |
57 |
Correct |
2 ms |
5076 KB |
Output is correct |
58 |
Correct |
3 ms |
5204 KB |
Output is correct |
59 |
Correct |
3 ms |
5460 KB |
Output is correct |
60 |
Correct |
3 ms |
5972 KB |
Output is correct |
61 |
Correct |
3 ms |
6096 KB |
Output is correct |
62 |
Correct |
3 ms |
5972 KB |
Output is correct |
63 |
Correct |
3 ms |
5076 KB |
Output is correct |
64 |
Correct |
3 ms |
5332 KB |
Output is correct |
65 |
Correct |
3 ms |
6100 KB |
Output is correct |
66 |
Correct |
3 ms |
5096 KB |
Output is correct |
67 |
Correct |
3 ms |
5236 KB |
Output is correct |
68 |
Correct |
7 ms |
14420 KB |
Output is correct |
69 |
Correct |
6 ms |
14292 KB |
Output is correct |
70 |
Correct |
4 ms |
7892 KB |
Output is correct |
71 |
Correct |
4 ms |
9044 KB |
Output is correct |
72 |
Correct |
3 ms |
5460 KB |
Output is correct |
73 |
Correct |
4 ms |
5204 KB |
Output is correct |
74 |
Correct |
3 ms |
5216 KB |
Output is correct |
75 |
Correct |
3 ms |
5204 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 KB |
Output is correct |
3 |
Correct |
2 ms |
4948 KB |
Output is correct |
4 |
Correct |
2 ms |
4948 KB |
Output is correct |
5 |
Correct |
2 ms |
5204 KB |
Output is correct |
6 |
Correct |
2 ms |
5076 KB |
Output is correct |
7 |
Correct |
2 ms |
4948 KB |
Output is correct |
8 |
Correct |
2 ms |
5076 KB |
Output is correct |
9 |
Correct |
2 ms |
5204 KB |
Output is correct |
10 |
Correct |
2 ms |
5332 KB |
Output is correct |
11 |
Correct |
2 ms |
5460 KB |
Output is correct |
12 |
Correct |
2 ms |
5460 KB |
Output is correct |
13 |
Correct |
3 ms |
5076 KB |
Output is correct |
14 |
Correct |
2 ms |
5076 KB |
Output is correct |
15 |
Correct |
3 ms |
5588 KB |
Output is correct |
16 |
Correct |
2 ms |
5204 KB |
Output is correct |
17 |
Correct |
3 ms |
6100 KB |
Output is correct |
18 |
Correct |
3 ms |
6100 KB |
Output is correct |
19 |
Correct |
2 ms |
5204 KB |
Output is correct |
20 |
Correct |
3 ms |
5076 KB |
Output is correct |
21 |
Correct |
2 ms |
5076 KB |
Output is correct |
22 |
Correct |
6 ms |
12372 KB |
Output is correct |
23 |
Correct |
5 ms |
10196 KB |
Output is correct |
24 |
Correct |
8 ms |
16980 KB |
Output is correct |
25 |
Correct |
9 ms |
16980 KB |
Output is correct |
26 |
Correct |
4 ms |
5460 KB |
Output is correct |
27 |
Correct |
12 ms |
5844 KB |
Output is correct |
28 |
Correct |
12 ms |
5648 KB |
Output is correct |
29 |
Correct |
96 ms |
203688 KB |
Output is correct |
30 |
Correct |
73 ms |
137292 KB |
Output is correct |
31 |
Correct |
29 ms |
40148 KB |
Output is correct |
32 |
Correct |
105 ms |
217420 KB |
Output is correct |
33 |
Correct |
102 ms |
217464 KB |
Output is correct |
34 |
Correct |
2 ms |
4948 KB |
Output is correct |
35 |
Correct |
2 ms |
4948 KB |
Output is correct |
36 |
Correct |
2 ms |
5076 KB |
Output is correct |
37 |
Correct |
2 ms |
5076 KB |
Output is correct |
38 |
Correct |
2 ms |
5076 KB |
Output is correct |
39 |
Correct |
3 ms |
5076 KB |
Output is correct |
40 |
Correct |
2 ms |
4948 KB |
Output is correct |
41 |
Correct |
2 ms |
5076 KB |
Output is correct |
42 |
Correct |
2 ms |
5076 KB |
Output is correct |
43 |
Correct |
2 ms |
4948 KB |
Output is correct |
44 |
Correct |
2 ms |
5076 KB |
Output is correct |
45 |
Correct |
2 ms |
5076 KB |
Output is correct |
46 |
Correct |
2 ms |
5076 KB |
Output is correct |
47 |
Correct |
3 ms |
5076 KB |
Output is correct |
48 |
Correct |
3 ms |
5076 KB |
Output is correct |
49 |
Correct |
2 ms |
4948 KB |
Output is correct |
50 |
Correct |
2 ms |
4948 KB |
Output is correct |
51 |
Correct |
2 ms |
4948 KB |
Output is correct |
52 |
Correct |
3 ms |
5096 KB |
Output is correct |
53 |
Correct |
2 ms |
5076 KB |
Output is correct |
54 |
Correct |
2 ms |
5076 KB |
Output is correct |
55 |
Correct |
2 ms |
5076 KB |
Output is correct |
56 |
Correct |
2 ms |
5076 KB |
Output is correct |
57 |
Correct |
2 ms |
5076 KB |
Output is correct |
58 |
Correct |
3 ms |
5972 KB |
Output is correct |
59 |
Correct |
2 ms |
5204 KB |
Output is correct |
60 |
Correct |
3 ms |
5460 KB |
Output is correct |
61 |
Correct |
2 ms |
5204 KB |
Output is correct |
62 |
Correct |
2 ms |
5076 KB |
Output is correct |
63 |
Correct |
2 ms |
5076 KB |
Output is correct |
64 |
Correct |
2 ms |
5076 KB |
Output is correct |
65 |
Correct |
2 ms |
5076 KB |
Output is correct |
66 |
Correct |
3 ms |
5204 KB |
Output is correct |
67 |
Correct |
3 ms |
5460 KB |
Output is correct |
68 |
Correct |
3 ms |
5972 KB |
Output is correct |
69 |
Correct |
3 ms |
6096 KB |
Output is correct |
70 |
Correct |
3 ms |
5972 KB |
Output is correct |
71 |
Correct |
3 ms |
5076 KB |
Output is correct |
72 |
Correct |
3 ms |
5332 KB |
Output is correct |
73 |
Correct |
3 ms |
6100 KB |
Output is correct |
74 |
Correct |
3 ms |
5096 KB |
Output is correct |
75 |
Correct |
3 ms |
5236 KB |
Output is correct |
76 |
Correct |
7 ms |
14420 KB |
Output is correct |
77 |
Correct |
6 ms |
14292 KB |
Output is correct |
78 |
Correct |
4 ms |
7892 KB |
Output is correct |
79 |
Correct |
4 ms |
9044 KB |
Output is correct |
80 |
Correct |
3 ms |
5460 KB |
Output is correct |
81 |
Correct |
4 ms |
5204 KB |
Output is correct |
82 |
Correct |
3 ms |
5216 KB |
Output is correct |
83 |
Correct |
3 ms |
5204 KB |
Output is correct |
84 |
Correct |
4 ms |
5460 KB |
Output is correct |
85 |
Correct |
5 ms |
6484 KB |
Output is correct |
86 |
Correct |
5 ms |
6100 KB |
Output is correct |
87 |
Correct |
5 ms |
6996 KB |
Output is correct |
88 |
Correct |
6 ms |
6996 KB |
Output is correct |
89 |
Correct |
9 ms |
5972 KB |
Output is correct |
90 |
Correct |
11 ms |
6624 KB |
Output is correct |
91 |
Incorrect |
26 ms |
22720 KB |
1st lines differ - on the 1st token, expected: '626', found: '601' |
92 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 KB |
Output is correct |
3 |
Correct |
2 ms |
4948 KB |
Output is correct |
4 |
Correct |
2 ms |
4948 KB |
Output is correct |
5 |
Correct |
2 ms |
5204 KB |
Output is correct |
6 |
Correct |
2 ms |
5076 KB |
Output is correct |
7 |
Correct |
2 ms |
4948 KB |
Output is correct |
8 |
Correct |
2 ms |
5076 KB |
Output is correct |
9 |
Correct |
2 ms |
5204 KB |
Output is correct |
10 |
Correct |
2 ms |
5332 KB |
Output is correct |
11 |
Correct |
2 ms |
5460 KB |
Output is correct |
12 |
Correct |
2 ms |
5460 KB |
Output is correct |
13 |
Correct |
3 ms |
5076 KB |
Output is correct |
14 |
Correct |
2 ms |
5076 KB |
Output is correct |
15 |
Correct |
3 ms |
5588 KB |
Output is correct |
16 |
Correct |
2 ms |
5204 KB |
Output is correct |
17 |
Correct |
3 ms |
6100 KB |
Output is correct |
18 |
Correct |
3 ms |
6100 KB |
Output is correct |
19 |
Correct |
2 ms |
5204 KB |
Output is correct |
20 |
Correct |
3 ms |
5076 KB |
Output is correct |
21 |
Correct |
2 ms |
5076 KB |
Output is correct |
22 |
Correct |
6 ms |
12372 KB |
Output is correct |
23 |
Correct |
5 ms |
10196 KB |
Output is correct |
24 |
Correct |
8 ms |
16980 KB |
Output is correct |
25 |
Correct |
9 ms |
16980 KB |
Output is correct |
26 |
Correct |
4 ms |
5460 KB |
Output is correct |
27 |
Correct |
12 ms |
5844 KB |
Output is correct |
28 |
Correct |
12 ms |
5648 KB |
Output is correct |
29 |
Correct |
96 ms |
203688 KB |
Output is correct |
30 |
Correct |
73 ms |
137292 KB |
Output is correct |
31 |
Correct |
29 ms |
40148 KB |
Output is correct |
32 |
Correct |
105 ms |
217420 KB |
Output is correct |
33 |
Correct |
102 ms |
217464 KB |
Output is correct |
34 |
Correct |
2 ms |
4948 KB |
Output is correct |
35 |
Correct |
2 ms |
4948 KB |
Output is correct |
36 |
Correct |
2 ms |
5076 KB |
Output is correct |
37 |
Correct |
2 ms |
5076 KB |
Output is correct |
38 |
Correct |
2 ms |
5076 KB |
Output is correct |
39 |
Correct |
3 ms |
5076 KB |
Output is correct |
40 |
Correct |
2 ms |
4948 KB |
Output is correct |
41 |
Correct |
2 ms |
5076 KB |
Output is correct |
42 |
Correct |
2 ms |
5076 KB |
Output is correct |
43 |
Correct |
2 ms |
4948 KB |
Output is correct |
44 |
Correct |
2 ms |
5076 KB |
Output is correct |
45 |
Correct |
2 ms |
5076 KB |
Output is correct |
46 |
Correct |
2 ms |
5076 KB |
Output is correct |
47 |
Correct |
3 ms |
5076 KB |
Output is correct |
48 |
Correct |
3 ms |
5076 KB |
Output is correct |
49 |
Correct |
2 ms |
4948 KB |
Output is correct |
50 |
Correct |
2 ms |
4948 KB |
Output is correct |
51 |
Correct |
2 ms |
4948 KB |
Output is correct |
52 |
Correct |
3 ms |
5096 KB |
Output is correct |
53 |
Correct |
2 ms |
5076 KB |
Output is correct |
54 |
Correct |
2 ms |
5076 KB |
Output is correct |
55 |
Correct |
2 ms |
5076 KB |
Output is correct |
56 |
Correct |
2 ms |
5076 KB |
Output is correct |
57 |
Correct |
2 ms |
5076 KB |
Output is correct |
58 |
Correct |
3 ms |
5972 KB |
Output is correct |
59 |
Correct |
2 ms |
5204 KB |
Output is correct |
60 |
Correct |
3 ms |
5460 KB |
Output is correct |
61 |
Correct |
2 ms |
5204 KB |
Output is correct |
62 |
Correct |
2 ms |
5076 KB |
Output is correct |
63 |
Correct |
2 ms |
5076 KB |
Output is correct |
64 |
Correct |
2 ms |
5076 KB |
Output is correct |
65 |
Correct |
2 ms |
5076 KB |
Output is correct |
66 |
Correct |
3 ms |
5204 KB |
Output is correct |
67 |
Correct |
3 ms |
5460 KB |
Output is correct |
68 |
Correct |
3 ms |
5972 KB |
Output is correct |
69 |
Correct |
3 ms |
6096 KB |
Output is correct |
70 |
Correct |
3 ms |
5972 KB |
Output is correct |
71 |
Correct |
3 ms |
5076 KB |
Output is correct |
72 |
Correct |
3 ms |
5332 KB |
Output is correct |
73 |
Correct |
3 ms |
6100 KB |
Output is correct |
74 |
Correct |
3 ms |
5096 KB |
Output is correct |
75 |
Correct |
3 ms |
5236 KB |
Output is correct |
76 |
Correct |
7 ms |
14420 KB |
Output is correct |
77 |
Correct |
6 ms |
14292 KB |
Output is correct |
78 |
Correct |
4 ms |
7892 KB |
Output is correct |
79 |
Correct |
4 ms |
9044 KB |
Output is correct |
80 |
Correct |
3 ms |
5460 KB |
Output is correct |
81 |
Correct |
4 ms |
5204 KB |
Output is correct |
82 |
Correct |
3 ms |
5216 KB |
Output is correct |
83 |
Correct |
3 ms |
5204 KB |
Output is correct |
84 |
Correct |
4 ms |
5460 KB |
Output is correct |
85 |
Correct |
5 ms |
6484 KB |
Output is correct |
86 |
Correct |
5 ms |
6100 KB |
Output is correct |
87 |
Correct |
5 ms |
6996 KB |
Output is correct |
88 |
Correct |
6 ms |
6996 KB |
Output is correct |
89 |
Correct |
9 ms |
5972 KB |
Output is correct |
90 |
Correct |
11 ms |
6624 KB |
Output is correct |
91 |
Incorrect |
26 ms |
22720 KB |
1st lines differ - on the 1st token, expected: '626', found: '601' |
92 |
Halted |
0 ms |
0 KB |
- |