#include "dreaming.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll INF=1e9,LINF=1e18;
#define fi first
#define se second
#define pii pair<int,int>
#define mid ((l+r)/2)
#define sz(a) (int((a).size()))
#define all(a) a.begin(),a.end()
#define endl "\n"
#define PRINT(x) cerr<<#x<<'='<<x<<endl;
#define pb push_back
#define PRINTvec(arr) { cerr<<#arr<<"="; for(auto h:arr) cerr<<h<<" "; cerr<<endl; }
int travelTime(int N, int M, int L, int A[], int B[], int T[]) {
vector<int> adj[N+1];
map<pair<int,int>,ll> edge;
for(int i=0;i<M;i++){
int u=A[i],v=B[i],w=T[i];
u++; v++;
adj[u].pb(v);
adj[v].pb(u);
edge[{u,v}]=w;
edge[{v,u}]=w;
}
vector<int> trees[N+1];
vector<bool> vis(N+1,false);
int idx=1;
function<void(int,int)> dfs=[&](int node,int prev){
vis[node]=true;
trees[idx].pb(node);
for(auto v:adj[node]) if(v!=prev) dfs(v,node);
};
for(int i=1;i<=N;i++){
if(!vis[i]){
dfs(i,-1);
idx++;
}
}
vector<ll> nadstablo_udaljenost(N+1),podstablo_udaljenost1(N+1),podstablo_udaljenost2(N+1);
vector<ll> udaljenost(N+1),dubina(N+1);
function<void(int,int)> dfs1=[&](int node,int prev){
podstablo_udaljenost1[node]=0; podstablo_udaljenost2[node]=0;
if(prev!=-1) dubina[node]=dubina[prev]+1;
else dubina[node]=0;
vector<ll> tmp; tmp.pb(0); tmp.pb(0);
for(auto v:adj[node]){
if(v!=prev){
dfs1(v,node);
tmp.pb(podstablo_udaljenost1[v]+edge[{node,v}]);
}
}
sort(all(tmp),greater<int>());
podstablo_udaljenost1[node]=tmp[0]; podstablo_udaljenost2[node]=tmp[1];
};
function<void(int,int)> dfs2=[&](int node,int prev){
nadstablo_udaljenost[node]=0;
if(prev!=-1){
nadstablo_udaljenost[node]=nadstablo_udaljenost[prev]+edge[{prev,node}];
}
for(auto v:adj[prev]){
if(dubina[v]>dubina[prev] && v!=node){
nadstablo_udaljenost[node]=max(nadstablo_udaljenost[node],podstablo_udaljenost1[v]+edge[{v,prev}]+edge[{prev,node}]);
}
}
for(auto v:adj[node]) if(v!=prev) dfs2(v,node);
udaljenost[node]=max(nadstablo_udaljenost[node],podstablo_udaljenost1[node]);
};
vector<pii> all_trees;
for(int i=1;i<idx;i++){
int root=trees[i][0];
dfs1(root,-1);
dfs2(root,-1);
int tmp_node=0;
ll tmp_val=LINF;
for(auto v:trees[i]){
if(udaljenost[v]<=tmp_val){
tmp_val=udaljenost[v]; tmp_node=v;
}
}
all_trees.pb({tmp_val,tmp_node});
}
sort(all(all_trees),greater<pair<ll,ll>>());
for(int i=1;i<sz(all_trees);i++){
int node=all_trees[i].se;
int first=all_trees[0].se;
adj[node].pb(first); adj[first].pb(node);
edge[{node,first}]=L; edge[{first,node}]=L;
}
/*
int node=0; ll val=LINF;
for(int i=1;i<idx;i++){
int root=trees[i][0];
dfs1(root,-1);
dfs2(root,-1);
if(i==1){
for(auto v:trees[i]){
if(udaljenost[v]<=val){
val=udaljenost[v]; node=v;
}
}
}
else{
int tmp_node=0,tmp_val=INF;
for(auto v:trees[i]){
if(udaljenost[v]<=tmp_val){
tmp_val=udaljenost[v]; tmp_node=v;
}
}
adj[tmp_node].pb(node); adj[node].pb(tmp_node);
edge[{tmp_node,node}]=L; edge[{node,tmp_node}]=L;
}
}
*/
/*
for(int i=1;i<idx;i++){
PRINTvec(trees[i]);
for(auto v:trees[i]){
cout<<"nadstablo_udaljenost["<<v<<"]="<<nadstablo_udaljenost[v]<<endl;
cout<<"podstablo_udaljenost1["<<v<<"]="<<podstablo_udaljenost1[v]<<endl;
cout<<"podstablo_udaljenost2["<<v<<"]="<<podstablo_udaljenost2[v]<<endl;
cout<<"udaljenost["<<v<<"]="<<udaljenost[v]<<endl;
cout<<"dubina["<<v<<"]="<<dubina[v]<<endl;
cout<<endl;
}
cout<<endl<<endl;
}
*/
dfs1(1,-1);
ll diametar=0;
for(int node=1;node<=N;node++){
diametar=max(diametar,podstablo_udaljenost1[node]+podstablo_udaljenost2[node]);
}
return diametar;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
334 ms |
34224 KB |
Output is correct |
2 |
Correct |
307 ms |
33328 KB |
Output is correct |
3 |
Correct |
171 ms |
26176 KB |
Output is correct |
4 |
Correct |
24 ms |
5196 KB |
Output is correct |
5 |
Correct |
20 ms |
3468 KB |
Output is correct |
6 |
Correct |
44 ms |
7628 KB |
Output is correct |
7 |
Correct |
1 ms |
336 KB |
Output is correct |
8 |
Correct |
125 ms |
14576 KB |
Output is correct |
9 |
Correct |
216 ms |
21100 KB |
Output is correct |
10 |
Correct |
1 ms |
460 KB |
Output is correct |
11 |
Correct |
301 ms |
25208 KB |
Output is correct |
12 |
Correct |
356 ms |
29484 KB |
Output is correct |
13 |
Correct |
2 ms |
588 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
0 ms |
204 KB |
Output is correct |
8 |
Correct |
1 ms |
204 KB |
Output is correct |
9 |
Correct |
1 ms |
204 KB |
Output is correct |
10 |
Correct |
1 ms |
204 KB |
Output is correct |
11 |
Correct |
1 ms |
332 KB |
Output is correct |
12 |
Correct |
1 ms |
204 KB |
Output is correct |
13 |
Correct |
1 ms |
204 KB |
Output is correct |
14 |
Correct |
1 ms |
332 KB |
Output is correct |
15 |
Correct |
1 ms |
204 KB |
Output is correct |
16 |
Correct |
1 ms |
332 KB |
Output is correct |
17 |
Correct |
1 ms |
204 KB |
Output is correct |
18 |
Correct |
1 ms |
332 KB |
Output is correct |
19 |
Correct |
0 ms |
332 KB |
Output is correct |
20 |
Correct |
1 ms |
332 KB |
Output is correct |
21 |
Correct |
1 ms |
332 KB |
Output is correct |
22 |
Correct |
1 ms |
204 KB |
Output is correct |
23 |
Correct |
0 ms |
204 KB |
Output is correct |
24 |
Correct |
1 ms |
332 KB |
Output is correct |
25 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
334 ms |
34224 KB |
Output is correct |
2 |
Correct |
307 ms |
33328 KB |
Output is correct |
3 |
Correct |
171 ms |
26176 KB |
Output is correct |
4 |
Correct |
24 ms |
5196 KB |
Output is correct |
5 |
Correct |
20 ms |
3468 KB |
Output is correct |
6 |
Correct |
44 ms |
7628 KB |
Output is correct |
7 |
Correct |
1 ms |
336 KB |
Output is correct |
8 |
Correct |
125 ms |
14576 KB |
Output is correct |
9 |
Correct |
216 ms |
21100 KB |
Output is correct |
10 |
Correct |
1 ms |
460 KB |
Output is correct |
11 |
Correct |
301 ms |
25208 KB |
Output is correct |
12 |
Correct |
356 ms |
29484 KB |
Output is correct |
13 |
Correct |
2 ms |
588 KB |
Output is correct |
14 |
Correct |
1 ms |
204 KB |
Output is correct |
15 |
Correct |
1 ms |
204 KB |
Output is correct |
16 |
Correct |
1 ms |
332 KB |
Output is correct |
17 |
Correct |
1 ms |
332 KB |
Output is correct |
18 |
Correct |
1 ms |
204 KB |
Output is correct |
19 |
Correct |
1 ms |
332 KB |
Output is correct |
20 |
Correct |
0 ms |
204 KB |
Output is correct |
21 |
Correct |
1 ms |
204 KB |
Output is correct |
22 |
Correct |
1 ms |
204 KB |
Output is correct |
23 |
Correct |
1 ms |
204 KB |
Output is correct |
24 |
Correct |
1 ms |
332 KB |
Output is correct |
25 |
Correct |
1 ms |
204 KB |
Output is correct |
26 |
Correct |
1 ms |
204 KB |
Output is correct |
27 |
Correct |
1 ms |
332 KB |
Output is correct |
28 |
Correct |
1 ms |
204 KB |
Output is correct |
29 |
Correct |
1 ms |
332 KB |
Output is correct |
30 |
Correct |
1 ms |
204 KB |
Output is correct |
31 |
Correct |
1 ms |
332 KB |
Output is correct |
32 |
Correct |
0 ms |
332 KB |
Output is correct |
33 |
Correct |
1 ms |
332 KB |
Output is correct |
34 |
Correct |
1 ms |
332 KB |
Output is correct |
35 |
Correct |
1 ms |
204 KB |
Output is correct |
36 |
Correct |
0 ms |
204 KB |
Output is correct |
37 |
Correct |
1 ms |
332 KB |
Output is correct |
38 |
Correct |
1 ms |
204 KB |
Output is correct |
39 |
Correct |
345 ms |
34152 KB |
Output is correct |
40 |
Correct |
311 ms |
33328 KB |
Output is correct |
41 |
Correct |
180 ms |
26320 KB |
Output is correct |
42 |
Correct |
23 ms |
5196 KB |
Output is correct |
43 |
Correct |
1 ms |
204 KB |
Output is correct |
44 |
Correct |
1 ms |
204 KB |
Output is correct |
45 |
Correct |
1 ms |
332 KB |
Output is correct |
46 |
Correct |
1 ms |
204 KB |
Output is correct |
47 |
Correct |
1 ms |
332 KB |
Output is correct |
48 |
Correct |
0 ms |
204 KB |
Output is correct |
49 |
Correct |
1 ms |
204 KB |
Output is correct |
50 |
Correct |
0 ms |
204 KB |
Output is correct |
51 |
Correct |
1 ms |
204 KB |
Output is correct |
52 |
Correct |
1 ms |
332 KB |
Output is correct |
53 |
Correct |
1 ms |
204 KB |
Output is correct |
54 |
Correct |
1 ms |
204 KB |
Output is correct |
55 |
Correct |
0 ms |
204 KB |
Output is correct |
56 |
Correct |
1 ms |
204 KB |
Output is correct |
57 |
Correct |
477 ms |
26148 KB |
Output is correct |
58 |
Correct |
473 ms |
26284 KB |
Output is correct |
59 |
Correct |
465 ms |
26356 KB |
Output is correct |
60 |
Correct |
469 ms |
26468 KB |
Output is correct |
61 |
Correct |
472 ms |
26300 KB |
Output is correct |
62 |
Correct |
497 ms |
26436 KB |
Output is correct |
63 |
Correct |
475 ms |
26304 KB |
Output is correct |
64 |
Correct |
460 ms |
26288 KB |
Output is correct |
65 |
Correct |
485 ms |
26372 KB |
Output is correct |
66 |
Correct |
464 ms |
26352 KB |
Output is correct |
67 |
Correct |
475 ms |
26564 KB |
Output is correct |
68 |
Correct |
471 ms |
26484 KB |
Output is correct |
69 |
Correct |
481 ms |
26432 KB |
Output is correct |
70 |
Correct |
470 ms |
26376 KB |
Output is correct |
71 |
Correct |
0 ms |
204 KB |
Output is correct |
72 |
Correct |
7 ms |
1100 KB |
Output is correct |
73 |
Correct |
6 ms |
1120 KB |
Output is correct |
74 |
Correct |
6 ms |
1100 KB |
Output is correct |
75 |
Correct |
6 ms |
1100 KB |
Output is correct |
76 |
Correct |
6 ms |
1100 KB |
Output is correct |
77 |
Correct |
6 ms |
1100 KB |
Output is correct |
78 |
Correct |
6 ms |
1108 KB |
Output is correct |
79 |
Correct |
6 ms |
1100 KB |
Output is correct |
80 |
Correct |
484 ms |
26472 KB |
Output is correct |
81 |
Correct |
469 ms |
26564 KB |
Output is correct |
82 |
Correct |
511 ms |
26568 KB |
Output is correct |
83 |
Correct |
476 ms |
26432 KB |
Output is correct |
84 |
Correct |
32 ms |
964 KB |
Output is correct |
85 |
Correct |
24 ms |
872 KB |
Output is correct |
86 |
Correct |
17 ms |
964 KB |
Output is correct |
87 |
Correct |
5 ms |
1012 KB |
Output is correct |
88 |
Correct |
21 ms |
972 KB |
Output is correct |
89 |
Correct |
19 ms |
1012 KB |
Output is correct |
90 |
Correct |
5 ms |
972 KB |
Output is correct |
91 |
Correct |
6 ms |
992 KB |
Output is correct |
92 |
Correct |
6 ms |
972 KB |
Output is correct |
93 |
Correct |
15 ms |
1004 KB |
Output is correct |
94 |
Correct |
1 ms |
332 KB |
Output is correct |
95 |
Correct |
1 ms |
204 KB |
Output is correct |
96 |
Correct |
0 ms |
204 KB |
Output is correct |
97 |
Correct |
1 ms |
332 KB |
Output is correct |
98 |
Correct |
1 ms |
204 KB |
Output is correct |
99 |
Correct |
1 ms |
332 KB |
Output is correct |
100 |
Correct |
1 ms |
332 KB |
Output is correct |
101 |
Correct |
1 ms |
332 KB |
Output is correct |
102 |
Correct |
1 ms |
332 KB |
Output is correct |
103 |
Correct |
1 ms |
332 KB |
Output is correct |
104 |
Correct |
25 ms |
3412 KB |
Output is correct |
105 |
Correct |
50 ms |
7732 KB |
Output is correct |
106 |
Correct |
1 ms |
332 KB |
Output is correct |
107 |
Correct |
173 ms |
14568 KB |
Output is correct |
108 |
Correct |
174 ms |
21056 KB |
Output is correct |
109 |
Correct |
1 ms |
460 KB |
Output is correct |
110 |
Correct |
296 ms |
25024 KB |
Output is correct |
111 |
Correct |
349 ms |
29500 KB |
Output is correct |
112 |
Correct |
2 ms |
588 KB |
Output is correct |
113 |
Correct |
483 ms |
46188 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
172 ms |
26836 KB |
Output is correct |
2 |
Correct |
177 ms |
27300 KB |
Output is correct |
3 |
Correct |
171 ms |
27196 KB |
Output is correct |
4 |
Correct |
174 ms |
27376 KB |
Output is correct |
5 |
Correct |
173 ms |
27196 KB |
Output is correct |
6 |
Correct |
188 ms |
29788 KB |
Output is correct |
7 |
Correct |
183 ms |
28464 KB |
Output is correct |
8 |
Correct |
165 ms |
26788 KB |
Output is correct |
9 |
Correct |
180 ms |
26668 KB |
Output is correct |
10 |
Correct |
180 ms |
28220 KB |
Output is correct |
11 |
Correct |
1 ms |
332 KB |
Output is correct |
12 |
Correct |
91 ms |
30400 KB |
Output is correct |
13 |
Correct |
93 ms |
30444 KB |
Output is correct |
14 |
Correct |
94 ms |
30348 KB |
Output is correct |
15 |
Correct |
101 ms |
30360 KB |
Output is correct |
16 |
Correct |
91 ms |
30404 KB |
Output is correct |
17 |
Correct |
96 ms |
30412 KB |
Output is correct |
18 |
Correct |
91 ms |
30556 KB |
Output is correct |
19 |
Correct |
89 ms |
30328 KB |
Output is correct |
20 |
Correct |
0 ms |
204 KB |
Output is correct |
21 |
Correct |
0 ms |
204 KB |
Output is correct |
22 |
Correct |
3 ms |
1228 KB |
Output is correct |
23 |
Correct |
90 ms |
30392 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
0 ms |
204 KB |
Output is correct |
8 |
Correct |
1 ms |
204 KB |
Output is correct |
9 |
Correct |
1 ms |
204 KB |
Output is correct |
10 |
Correct |
1 ms |
204 KB |
Output is correct |
11 |
Correct |
1 ms |
332 KB |
Output is correct |
12 |
Correct |
1 ms |
204 KB |
Output is correct |
13 |
Correct |
1 ms |
204 KB |
Output is correct |
14 |
Correct |
1 ms |
332 KB |
Output is correct |
15 |
Correct |
1 ms |
204 KB |
Output is correct |
16 |
Correct |
1 ms |
332 KB |
Output is correct |
17 |
Correct |
1 ms |
204 KB |
Output is correct |
18 |
Correct |
1 ms |
332 KB |
Output is correct |
19 |
Correct |
0 ms |
332 KB |
Output is correct |
20 |
Correct |
1 ms |
332 KB |
Output is correct |
21 |
Correct |
1 ms |
332 KB |
Output is correct |
22 |
Correct |
1 ms |
204 KB |
Output is correct |
23 |
Correct |
0 ms |
204 KB |
Output is correct |
24 |
Correct |
1 ms |
332 KB |
Output is correct |
25 |
Correct |
1 ms |
204 KB |
Output is correct |
26 |
Correct |
3 ms |
460 KB |
Output is correct |
27 |
Correct |
7 ms |
844 KB |
Output is correct |
28 |
Correct |
15 ms |
1024 KB |
Output is correct |
29 |
Correct |
3 ms |
460 KB |
Output is correct |
30 |
Correct |
13 ms |
944 KB |
Output is correct |
31 |
Correct |
25 ms |
1060 KB |
Output is correct |
32 |
Correct |
4 ms |
460 KB |
Output is correct |
33 |
Correct |
15 ms |
820 KB |
Output is correct |
34 |
Correct |
34 ms |
1060 KB |
Output is correct |
35 |
Correct |
0 ms |
204 KB |
Output is correct |
36 |
Correct |
1 ms |
332 KB |
Output is correct |
37 |
Correct |
1 ms |
332 KB |
Output is correct |
38 |
Correct |
1 ms |
332 KB |
Output is correct |
39 |
Correct |
1 ms |
332 KB |
Output is correct |
40 |
Correct |
1 ms |
288 KB |
Output is correct |
41 |
Correct |
1 ms |
332 KB |
Output is correct |
42 |
Correct |
1 ms |
284 KB |
Output is correct |
43 |
Correct |
1 ms |
296 KB |
Output is correct |
44 |
Correct |
1 ms |
332 KB |
Output is correct |
45 |
Correct |
1 ms |
204 KB |
Output is correct |
46 |
Correct |
1 ms |
332 KB |
Output is correct |
47 |
Correct |
1 ms |
288 KB |
Output is correct |
48 |
Correct |
1 ms |
332 KB |
Output is correct |
49 |
Correct |
1 ms |
288 KB |
Output is correct |
50 |
Correct |
1 ms |
300 KB |
Output is correct |
51 |
Correct |
1 ms |
204 KB |
Output is correct |
52 |
Correct |
1 ms |
300 KB |
Output is correct |
53 |
Correct |
1 ms |
204 KB |
Output is correct |
54 |
Correct |
6 ms |
1328 KB |
Output is correct |
55 |
Correct |
5 ms |
1476 KB |
Output is correct |
56 |
Correct |
5 ms |
1072 KB |
Output is correct |
57 |
Correct |
3 ms |
1176 KB |
Output is correct |
58 |
Correct |
6 ms |
1116 KB |
Output is correct |
59 |
Correct |
6 ms |
1076 KB |
Output is correct |
60 |
Correct |
4 ms |
1076 KB |
Output is correct |
61 |
Correct |
4 ms |
1168 KB |
Output is correct |
62 |
Correct |
6 ms |
1080 KB |
Output is correct |
63 |
Correct |
6 ms |
1100 KB |
Output is correct |
64 |
Correct |
3 ms |
1192 KB |
Output is correct |
65 |
Correct |
5 ms |
1068 KB |
Output is correct |
66 |
Correct |
6 ms |
1068 KB |
Output is correct |
67 |
Correct |
6 ms |
1080 KB |
Output is correct |
68 |
Correct |
6 ms |
1192 KB |
Output is correct |
69 |
Correct |
5 ms |
1076 KB |
Output is correct |
70 |
Correct |
3 ms |
1136 KB |
Output is correct |
71 |
Correct |
4 ms |
1080 KB |
Output is correct |
72 |
Correct |
5 ms |
1120 KB |
Output is correct |
73 |
Correct |
5 ms |
1076 KB |
Output is correct |
74 |
Correct |
6 ms |
1100 KB |
Output is correct |
75 |
Correct |
5 ms |
1068 KB |
Output is correct |
76 |
Correct |
6 ms |
1112 KB |
Output is correct |
77 |
Correct |
6 ms |
1096 KB |
Output is correct |
78 |
Correct |
4 ms |
1080 KB |
Output is correct |
79 |
Correct |
4 ms |
1072 KB |
Output is correct |
80 |
Correct |
3 ms |
1100 KB |
Output is correct |
81 |
Correct |
3 ms |
1120 KB |
Output is correct |
82 |
Correct |
5 ms |
1124 KB |
Output is correct |
83 |
Correct |
6 ms |
1120 KB |
Output is correct |
84 |
Correct |
4 ms |
1080 KB |
Output is correct |
85 |
Correct |
3 ms |
1228 KB |
Output is correct |
86 |
Correct |
5 ms |
1076 KB |
Output is correct |
87 |
Correct |
5 ms |
1100 KB |
Output is correct |
88 |
Correct |
4 ms |
1096 KB |
Output is correct |
89 |
Correct |
4 ms |
1080 KB |
Output is correct |
90 |
Correct |
4 ms |
1080 KB |
Output is correct |
91 |
Correct |
4 ms |
1100 KB |
Output is correct |
92 |
Correct |
31 ms |
852 KB |
Output is correct |
93 |
Correct |
25 ms |
876 KB |
Output is correct |
94 |
Correct |
18 ms |
976 KB |
Output is correct |
95 |
Correct |
5 ms |
972 KB |
Output is correct |
96 |
Correct |
21 ms |
940 KB |
Output is correct |
97 |
Correct |
19 ms |
972 KB |
Output is correct |
98 |
Correct |
5 ms |
964 KB |
Output is correct |
99 |
Correct |
6 ms |
1120 KB |
Output is correct |
100 |
Correct |
6 ms |
972 KB |
Output is correct |
101 |
Correct |
14 ms |
972 KB |
Output is correct |
102 |
Correct |
1 ms |
332 KB |
Output is correct |
103 |
Correct |
1 ms |
204 KB |
Output is correct |
104 |
Correct |
1 ms |
332 KB |
Output is correct |
105 |
Correct |
1 ms |
332 KB |
Output is correct |
106 |
Correct |
1 ms |
280 KB |
Output is correct |
107 |
Correct |
1 ms |
296 KB |
Output is correct |
108 |
Correct |
1 ms |
292 KB |
Output is correct |
109 |
Correct |
1 ms |
332 KB |
Output is correct |
110 |
Correct |
1 ms |
332 KB |
Output is correct |
111 |
Correct |
1 ms |
296 KB |
Output is correct |
112 |
Correct |
1 ms |
332 KB |
Output is correct |
113 |
Correct |
1 ms |
548 KB |
Output is correct |
114 |
Correct |
2 ms |
588 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
334 ms |
34224 KB |
Output is correct |
2 |
Correct |
307 ms |
33328 KB |
Output is correct |
3 |
Correct |
171 ms |
26176 KB |
Output is correct |
4 |
Correct |
24 ms |
5196 KB |
Output is correct |
5 |
Correct |
20 ms |
3468 KB |
Output is correct |
6 |
Correct |
44 ms |
7628 KB |
Output is correct |
7 |
Correct |
1 ms |
336 KB |
Output is correct |
8 |
Correct |
125 ms |
14576 KB |
Output is correct |
9 |
Correct |
216 ms |
21100 KB |
Output is correct |
10 |
Correct |
1 ms |
460 KB |
Output is correct |
11 |
Correct |
301 ms |
25208 KB |
Output is correct |
12 |
Correct |
356 ms |
29484 KB |
Output is correct |
13 |
Correct |
2 ms |
588 KB |
Output is correct |
14 |
Correct |
1 ms |
204 KB |
Output is correct |
15 |
Correct |
1 ms |
204 KB |
Output is correct |
16 |
Correct |
1 ms |
332 KB |
Output is correct |
17 |
Correct |
1 ms |
332 KB |
Output is correct |
18 |
Correct |
1 ms |
204 KB |
Output is correct |
19 |
Correct |
1 ms |
332 KB |
Output is correct |
20 |
Correct |
0 ms |
204 KB |
Output is correct |
21 |
Correct |
1 ms |
204 KB |
Output is correct |
22 |
Correct |
1 ms |
204 KB |
Output is correct |
23 |
Correct |
1 ms |
204 KB |
Output is correct |
24 |
Correct |
1 ms |
332 KB |
Output is correct |
25 |
Correct |
1 ms |
204 KB |
Output is correct |
26 |
Correct |
1 ms |
204 KB |
Output is correct |
27 |
Correct |
1 ms |
332 KB |
Output is correct |
28 |
Correct |
1 ms |
204 KB |
Output is correct |
29 |
Correct |
1 ms |
332 KB |
Output is correct |
30 |
Correct |
1 ms |
204 KB |
Output is correct |
31 |
Correct |
1 ms |
332 KB |
Output is correct |
32 |
Correct |
0 ms |
332 KB |
Output is correct |
33 |
Correct |
1 ms |
332 KB |
Output is correct |
34 |
Correct |
1 ms |
332 KB |
Output is correct |
35 |
Correct |
1 ms |
204 KB |
Output is correct |
36 |
Correct |
0 ms |
204 KB |
Output is correct |
37 |
Correct |
1 ms |
332 KB |
Output is correct |
38 |
Correct |
1 ms |
204 KB |
Output is correct |
39 |
Correct |
345 ms |
34152 KB |
Output is correct |
40 |
Correct |
311 ms |
33328 KB |
Output is correct |
41 |
Correct |
180 ms |
26320 KB |
Output is correct |
42 |
Correct |
23 ms |
5196 KB |
Output is correct |
43 |
Correct |
1 ms |
204 KB |
Output is correct |
44 |
Correct |
1 ms |
204 KB |
Output is correct |
45 |
Correct |
1 ms |
332 KB |
Output is correct |
46 |
Correct |
1 ms |
204 KB |
Output is correct |
47 |
Correct |
1 ms |
332 KB |
Output is correct |
48 |
Correct |
0 ms |
204 KB |
Output is correct |
49 |
Correct |
1 ms |
204 KB |
Output is correct |
50 |
Correct |
0 ms |
204 KB |
Output is correct |
51 |
Correct |
1 ms |
204 KB |
Output is correct |
52 |
Correct |
1 ms |
332 KB |
Output is correct |
53 |
Correct |
1 ms |
204 KB |
Output is correct |
54 |
Correct |
1 ms |
204 KB |
Output is correct |
55 |
Correct |
0 ms |
204 KB |
Output is correct |
56 |
Correct |
1 ms |
204 KB |
Output is correct |
57 |
Correct |
477 ms |
26148 KB |
Output is correct |
58 |
Correct |
473 ms |
26284 KB |
Output is correct |
59 |
Correct |
465 ms |
26356 KB |
Output is correct |
60 |
Correct |
469 ms |
26468 KB |
Output is correct |
61 |
Correct |
472 ms |
26300 KB |
Output is correct |
62 |
Correct |
497 ms |
26436 KB |
Output is correct |
63 |
Correct |
475 ms |
26304 KB |
Output is correct |
64 |
Correct |
460 ms |
26288 KB |
Output is correct |
65 |
Correct |
485 ms |
26372 KB |
Output is correct |
66 |
Correct |
464 ms |
26352 KB |
Output is correct |
67 |
Correct |
475 ms |
26564 KB |
Output is correct |
68 |
Correct |
471 ms |
26484 KB |
Output is correct |
69 |
Correct |
481 ms |
26432 KB |
Output is correct |
70 |
Correct |
470 ms |
26376 KB |
Output is correct |
71 |
Correct |
0 ms |
204 KB |
Output is correct |
72 |
Correct |
7 ms |
1100 KB |
Output is correct |
73 |
Correct |
6 ms |
1120 KB |
Output is correct |
74 |
Correct |
6 ms |
1100 KB |
Output is correct |
75 |
Correct |
6 ms |
1100 KB |
Output is correct |
76 |
Correct |
6 ms |
1100 KB |
Output is correct |
77 |
Correct |
6 ms |
1100 KB |
Output is correct |
78 |
Correct |
6 ms |
1108 KB |
Output is correct |
79 |
Correct |
6 ms |
1100 KB |
Output is correct |
80 |
Correct |
484 ms |
26472 KB |
Output is correct |
81 |
Correct |
469 ms |
26564 KB |
Output is correct |
82 |
Correct |
511 ms |
26568 KB |
Output is correct |
83 |
Correct |
476 ms |
26432 KB |
Output is correct |
84 |
Correct |
32 ms |
964 KB |
Output is correct |
85 |
Correct |
24 ms |
872 KB |
Output is correct |
86 |
Correct |
17 ms |
964 KB |
Output is correct |
87 |
Correct |
5 ms |
1012 KB |
Output is correct |
88 |
Correct |
21 ms |
972 KB |
Output is correct |
89 |
Correct |
19 ms |
1012 KB |
Output is correct |
90 |
Correct |
5 ms |
972 KB |
Output is correct |
91 |
Correct |
6 ms |
992 KB |
Output is correct |
92 |
Correct |
6 ms |
972 KB |
Output is correct |
93 |
Correct |
15 ms |
1004 KB |
Output is correct |
94 |
Correct |
1 ms |
332 KB |
Output is correct |
95 |
Correct |
1 ms |
204 KB |
Output is correct |
96 |
Correct |
0 ms |
204 KB |
Output is correct |
97 |
Correct |
1 ms |
332 KB |
Output is correct |
98 |
Correct |
1 ms |
204 KB |
Output is correct |
99 |
Correct |
1 ms |
332 KB |
Output is correct |
100 |
Correct |
1 ms |
332 KB |
Output is correct |
101 |
Correct |
1 ms |
332 KB |
Output is correct |
102 |
Correct |
1 ms |
332 KB |
Output is correct |
103 |
Correct |
1 ms |
332 KB |
Output is correct |
104 |
Correct |
25 ms |
3412 KB |
Output is correct |
105 |
Correct |
50 ms |
7732 KB |
Output is correct |
106 |
Correct |
1 ms |
332 KB |
Output is correct |
107 |
Correct |
173 ms |
14568 KB |
Output is correct |
108 |
Correct |
174 ms |
21056 KB |
Output is correct |
109 |
Correct |
1 ms |
460 KB |
Output is correct |
110 |
Correct |
296 ms |
25024 KB |
Output is correct |
111 |
Correct |
349 ms |
29500 KB |
Output is correct |
112 |
Correct |
2 ms |
588 KB |
Output is correct |
113 |
Correct |
483 ms |
46188 KB |
Output is correct |
114 |
Correct |
172 ms |
26836 KB |
Output is correct |
115 |
Correct |
177 ms |
27300 KB |
Output is correct |
116 |
Correct |
171 ms |
27196 KB |
Output is correct |
117 |
Correct |
174 ms |
27376 KB |
Output is correct |
118 |
Correct |
173 ms |
27196 KB |
Output is correct |
119 |
Correct |
188 ms |
29788 KB |
Output is correct |
120 |
Correct |
183 ms |
28464 KB |
Output is correct |
121 |
Correct |
165 ms |
26788 KB |
Output is correct |
122 |
Correct |
180 ms |
26668 KB |
Output is correct |
123 |
Correct |
180 ms |
28220 KB |
Output is correct |
124 |
Correct |
1 ms |
332 KB |
Output is correct |
125 |
Correct |
91 ms |
30400 KB |
Output is correct |
126 |
Correct |
93 ms |
30444 KB |
Output is correct |
127 |
Correct |
94 ms |
30348 KB |
Output is correct |
128 |
Correct |
101 ms |
30360 KB |
Output is correct |
129 |
Correct |
91 ms |
30404 KB |
Output is correct |
130 |
Correct |
96 ms |
30412 KB |
Output is correct |
131 |
Correct |
91 ms |
30556 KB |
Output is correct |
132 |
Correct |
89 ms |
30328 KB |
Output is correct |
133 |
Correct |
0 ms |
204 KB |
Output is correct |
134 |
Correct |
0 ms |
204 KB |
Output is correct |
135 |
Correct |
3 ms |
1228 KB |
Output is correct |
136 |
Correct |
90 ms |
30392 KB |
Output is correct |
137 |
Correct |
3 ms |
460 KB |
Output is correct |
138 |
Correct |
7 ms |
844 KB |
Output is correct |
139 |
Correct |
15 ms |
1024 KB |
Output is correct |
140 |
Correct |
3 ms |
460 KB |
Output is correct |
141 |
Correct |
13 ms |
944 KB |
Output is correct |
142 |
Correct |
25 ms |
1060 KB |
Output is correct |
143 |
Correct |
4 ms |
460 KB |
Output is correct |
144 |
Correct |
15 ms |
820 KB |
Output is correct |
145 |
Correct |
34 ms |
1060 KB |
Output is correct |
146 |
Correct |
0 ms |
204 KB |
Output is correct |
147 |
Correct |
1 ms |
332 KB |
Output is correct |
148 |
Correct |
1 ms |
332 KB |
Output is correct |
149 |
Correct |
1 ms |
332 KB |
Output is correct |
150 |
Correct |
1 ms |
332 KB |
Output is correct |
151 |
Correct |
1 ms |
288 KB |
Output is correct |
152 |
Correct |
1 ms |
332 KB |
Output is correct |
153 |
Correct |
1 ms |
284 KB |
Output is correct |
154 |
Correct |
1 ms |
296 KB |
Output is correct |
155 |
Correct |
1 ms |
332 KB |
Output is correct |
156 |
Correct |
1 ms |
204 KB |
Output is correct |
157 |
Correct |
1 ms |
332 KB |
Output is correct |
158 |
Correct |
1 ms |
288 KB |
Output is correct |
159 |
Correct |
1 ms |
332 KB |
Output is correct |
160 |
Correct |
1 ms |
288 KB |
Output is correct |
161 |
Correct |
1 ms |
300 KB |
Output is correct |
162 |
Correct |
1 ms |
204 KB |
Output is correct |
163 |
Correct |
1 ms |
300 KB |
Output is correct |
164 |
Correct |
1 ms |
204 KB |
Output is correct |
165 |
Correct |
6 ms |
1328 KB |
Output is correct |
166 |
Correct |
5 ms |
1476 KB |
Output is correct |
167 |
Correct |
5 ms |
1072 KB |
Output is correct |
168 |
Correct |
3 ms |
1176 KB |
Output is correct |
169 |
Correct |
6 ms |
1116 KB |
Output is correct |
170 |
Correct |
6 ms |
1076 KB |
Output is correct |
171 |
Correct |
4 ms |
1076 KB |
Output is correct |
172 |
Correct |
4 ms |
1168 KB |
Output is correct |
173 |
Correct |
6 ms |
1080 KB |
Output is correct |
174 |
Correct |
6 ms |
1100 KB |
Output is correct |
175 |
Correct |
3 ms |
1192 KB |
Output is correct |
176 |
Correct |
5 ms |
1068 KB |
Output is correct |
177 |
Correct |
6 ms |
1068 KB |
Output is correct |
178 |
Correct |
6 ms |
1080 KB |
Output is correct |
179 |
Correct |
6 ms |
1192 KB |
Output is correct |
180 |
Correct |
5 ms |
1076 KB |
Output is correct |
181 |
Correct |
3 ms |
1136 KB |
Output is correct |
182 |
Correct |
4 ms |
1080 KB |
Output is correct |
183 |
Correct |
5 ms |
1120 KB |
Output is correct |
184 |
Correct |
5 ms |
1076 KB |
Output is correct |
185 |
Correct |
6 ms |
1100 KB |
Output is correct |
186 |
Correct |
5 ms |
1068 KB |
Output is correct |
187 |
Correct |
6 ms |
1112 KB |
Output is correct |
188 |
Correct |
6 ms |
1096 KB |
Output is correct |
189 |
Correct |
4 ms |
1080 KB |
Output is correct |
190 |
Correct |
4 ms |
1072 KB |
Output is correct |
191 |
Correct |
3 ms |
1100 KB |
Output is correct |
192 |
Correct |
3 ms |
1120 KB |
Output is correct |
193 |
Correct |
5 ms |
1124 KB |
Output is correct |
194 |
Correct |
6 ms |
1120 KB |
Output is correct |
195 |
Correct |
4 ms |
1080 KB |
Output is correct |
196 |
Correct |
3 ms |
1228 KB |
Output is correct |
197 |
Correct |
5 ms |
1076 KB |
Output is correct |
198 |
Correct |
5 ms |
1100 KB |
Output is correct |
199 |
Correct |
4 ms |
1096 KB |
Output is correct |
200 |
Correct |
4 ms |
1080 KB |
Output is correct |
201 |
Correct |
4 ms |
1080 KB |
Output is correct |
202 |
Correct |
4 ms |
1100 KB |
Output is correct |
203 |
Correct |
31 ms |
852 KB |
Output is correct |
204 |
Correct |
25 ms |
876 KB |
Output is correct |
205 |
Correct |
18 ms |
976 KB |
Output is correct |
206 |
Correct |
5 ms |
972 KB |
Output is correct |
207 |
Correct |
21 ms |
940 KB |
Output is correct |
208 |
Correct |
19 ms |
972 KB |
Output is correct |
209 |
Correct |
5 ms |
964 KB |
Output is correct |
210 |
Correct |
6 ms |
1120 KB |
Output is correct |
211 |
Correct |
6 ms |
972 KB |
Output is correct |
212 |
Correct |
14 ms |
972 KB |
Output is correct |
213 |
Correct |
1 ms |
332 KB |
Output is correct |
214 |
Correct |
1 ms |
204 KB |
Output is correct |
215 |
Correct |
1 ms |
332 KB |
Output is correct |
216 |
Correct |
1 ms |
332 KB |
Output is correct |
217 |
Correct |
1 ms |
280 KB |
Output is correct |
218 |
Correct |
1 ms |
296 KB |
Output is correct |
219 |
Correct |
1 ms |
292 KB |
Output is correct |
220 |
Correct |
1 ms |
332 KB |
Output is correct |
221 |
Correct |
1 ms |
332 KB |
Output is correct |
222 |
Correct |
1 ms |
296 KB |
Output is correct |
223 |
Correct |
1 ms |
332 KB |
Output is correct |
224 |
Correct |
1 ms |
548 KB |
Output is correct |
225 |
Correct |
2 ms |
588 KB |
Output is correct |
226 |
Correct |
3 ms |
460 KB |
Output is correct |
227 |
Correct |
8 ms |
844 KB |
Output is correct |
228 |
Correct |
15 ms |
1064 KB |
Output is correct |
229 |
Execution timed out |
1052 ms |
20592 KB |
Time limit exceeded |
230 |
Halted |
0 ms |
0 KB |
- |