#include"beechtree.h"
#include<algorithm>
#include<set>
#include<iostream>
#include<map>
#include<queue>
using namespace std;
int n;
vector<int>ch[200000];
map<int,int>ch_col[200000];
int par[200000];
int col[200000];
bool bad[200000];
int sub[200000];
bool res[200000];
void dfs1(int node){
sub[node]=1;
for(int c:ch[node]){
dfs1(c);
sub[node]+=sub[c];
}
}
void dfs2(int node){
bad[node]=ch[node].size()!=ch_col[node].size();
for(int c:ch[node]){
dfs2(c);
bad[node]|=bad[c];
}
}
bool good(int a,int b){
for(auto[c,i]:ch_col[b])
if(ch_col[a][c]<i)
return false;
return true;
}
// merge into s1
bool merge(set<pair<int,int>>&s1,set<pair<int,int>>&s2){
bool res=true;
for(auto i:s2){
auto iter=s1.insert(i).first;
auto iter2=iter,iter3=iter;
if(iter3!=s1.begin()){
iter3--;
if(!good(iter->second,iter3->second))
res=false;
}
iter2++;
if(iter2!=s1.end()&&!good(iter2->second,iter->second))
res=false;
}
return res;
}
set<pair<int,int>>get(int node){
res[node]=!bad[node];
set<pair<int,int>>s;
s.insert({sub[node],node});
for(int c:ch[node]){
auto r=get(c);
res[node]&=res[c];
if(r.size()>s.size())
swap(s,r);
if(!merge(s,r))
res[node]=false;
}
return s;
}
vector<int>beechtree(int N,int M,vector<int>P,vector<int>C){
n=N;
for(int i=0;i<n;i++)
ch[i].clear();
for(int i=0;i<n;i++){
par[i]=P[i];
if(i)
ch[par[i]].push_back(i);
col[i]=C[i];
}
dfs1(0);
for(int i=0;i<n;i++){
ch_col[i].clear();
for(int c:ch[i])
ch_col[i][col[c]]=sub[c];
}
dfs2(0);
get(0);
vector<int>res2(n);
for(int i=0;i<n;i++)
res2[i]=res[i];
return res2;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
14424 KB |
Output is correct |
2 |
Correct |
6 ms |
14424 KB |
Output is correct |
3 |
Correct |
5 ms |
14560 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
14424 KB |
Output is correct |
2 |
Correct |
5 ms |
14428 KB |
Output is correct |
3 |
Correct |
6 ms |
14428 KB |
Output is correct |
4 |
Correct |
6 ms |
14428 KB |
Output is correct |
5 |
Correct |
7 ms |
14424 KB |
Output is correct |
6 |
Correct |
6 ms |
14428 KB |
Output is correct |
7 |
Correct |
5 ms |
14428 KB |
Output is correct |
8 |
Correct |
6 ms |
14536 KB |
Output is correct |
9 |
Correct |
6 ms |
14424 KB |
Output is correct |
10 |
Correct |
6 ms |
14428 KB |
Output is correct |
11 |
Correct |
5 ms |
14428 KB |
Output is correct |
12 |
Correct |
7 ms |
14444 KB |
Output is correct |
13 |
Correct |
6 ms |
14424 KB |
Output is correct |
14 |
Correct |
6 ms |
14428 KB |
Output is correct |
15 |
Correct |
8 ms |
14428 KB |
Output is correct |
16 |
Correct |
8 ms |
14428 KB |
Output is correct |
17 |
Correct |
7 ms |
14428 KB |
Output is correct |
18 |
Correct |
7 ms |
14428 KB |
Output is correct |
19 |
Correct |
6 ms |
14428 KB |
Output is correct |
20 |
Correct |
6 ms |
14428 KB |
Output is correct |
21 |
Correct |
6 ms |
14428 KB |
Output is correct |
22 |
Correct |
6 ms |
14428 KB |
Output is correct |
23 |
Correct |
6 ms |
14428 KB |
Output is correct |
24 |
Correct |
6 ms |
14480 KB |
Output is correct |
25 |
Correct |
5 ms |
14428 KB |
Output is correct |
26 |
Correct |
5 ms |
14428 KB |
Output is correct |
27 |
Correct |
6 ms |
14424 KB |
Output is correct |
28 |
Correct |
6 ms |
14428 KB |
Output is correct |
29 |
Correct |
6 ms |
14428 KB |
Output is correct |
30 |
Correct |
6 ms |
14424 KB |
Output is correct |
31 |
Correct |
6 ms |
14428 KB |
Output is correct |
32 |
Correct |
5 ms |
14428 KB |
Output is correct |
33 |
Correct |
6 ms |
14428 KB |
Output is correct |
34 |
Correct |
6 ms |
14428 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
14424 KB |
Output is correct |
2 |
Correct |
5 ms |
14428 KB |
Output is correct |
3 |
Correct |
6 ms |
14428 KB |
Output is correct |
4 |
Correct |
6 ms |
14428 KB |
Output is correct |
5 |
Correct |
7 ms |
14424 KB |
Output is correct |
6 |
Correct |
6 ms |
14428 KB |
Output is correct |
7 |
Correct |
314 ms |
185040 KB |
Output is correct |
8 |
Correct |
279 ms |
188232 KB |
Output is correct |
9 |
Correct |
6 ms |
14428 KB |
Output is correct |
10 |
Correct |
5 ms |
14416 KB |
Output is correct |
11 |
Correct |
6 ms |
14428 KB |
Output is correct |
12 |
Correct |
7 ms |
14684 KB |
Output is correct |
13 |
Correct |
7 ms |
14940 KB |
Output is correct |
14 |
Correct |
6 ms |
15192 KB |
Output is correct |
15 |
Correct |
8 ms |
15768 KB |
Output is correct |
16 |
Correct |
7 ms |
15704 KB |
Output is correct |
17 |
Correct |
153 ms |
78924 KB |
Output is correct |
18 |
Correct |
163 ms |
82252 KB |
Output is correct |
19 |
Correct |
282 ms |
178000 KB |
Output is correct |
20 |
Correct |
291 ms |
186708 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
14424 KB |
Output is correct |
2 |
Correct |
5 ms |
14428 KB |
Output is correct |
3 |
Correct |
6 ms |
14424 KB |
Output is correct |
4 |
Correct |
6 ms |
14428 KB |
Output is correct |
5 |
Correct |
6 ms |
14536 KB |
Output is correct |
6 |
Correct |
6 ms |
14428 KB |
Output is correct |
7 |
Correct |
6 ms |
14424 KB |
Output is correct |
8 |
Correct |
5 ms |
14428 KB |
Output is correct |
9 |
Correct |
5 ms |
14428 KB |
Output is correct |
10 |
Correct |
5 ms |
14428 KB |
Output is correct |
11 |
Correct |
6 ms |
14684 KB |
Output is correct |
12 |
Correct |
6 ms |
14684 KB |
Output is correct |
13 |
Correct |
6 ms |
14548 KB |
Output is correct |
14 |
Correct |
7 ms |
14684 KB |
Output is correct |
15 |
Correct |
85 ms |
28716 KB |
Output is correct |
16 |
Correct |
71 ms |
28060 KB |
Output is correct |
17 |
Correct |
76 ms |
28276 KB |
Output is correct |
18 |
Correct |
76 ms |
28500 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
14424 KB |
Output is correct |
2 |
Correct |
5 ms |
14428 KB |
Output is correct |
3 |
Correct |
5 ms |
14428 KB |
Output is correct |
4 |
Correct |
6 ms |
14536 KB |
Output is correct |
5 |
Correct |
314 ms |
185040 KB |
Output is correct |
6 |
Correct |
279 ms |
188232 KB |
Output is correct |
7 |
Correct |
6 ms |
14424 KB |
Output is correct |
8 |
Correct |
5 ms |
14428 KB |
Output is correct |
9 |
Correct |
7 ms |
15068 KB |
Output is correct |
10 |
Correct |
7 ms |
14684 KB |
Output is correct |
11 |
Correct |
258 ms |
90440 KB |
Output is correct |
12 |
Correct |
146 ms |
41808 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
14424 KB |
Output is correct |
2 |
Correct |
6 ms |
14424 KB |
Output is correct |
3 |
Correct |
5 ms |
14560 KB |
Output is correct |
4 |
Correct |
6 ms |
14424 KB |
Output is correct |
5 |
Correct |
5 ms |
14428 KB |
Output is correct |
6 |
Correct |
6 ms |
14428 KB |
Output is correct |
7 |
Correct |
6 ms |
14428 KB |
Output is correct |
8 |
Correct |
7 ms |
14424 KB |
Output is correct |
9 |
Correct |
6 ms |
14428 KB |
Output is correct |
10 |
Correct |
5 ms |
14428 KB |
Output is correct |
11 |
Correct |
6 ms |
14536 KB |
Output is correct |
12 |
Correct |
6 ms |
14424 KB |
Output is correct |
13 |
Correct |
6 ms |
14428 KB |
Output is correct |
14 |
Correct |
5 ms |
14428 KB |
Output is correct |
15 |
Correct |
7 ms |
14444 KB |
Output is correct |
16 |
Correct |
6 ms |
14424 KB |
Output is correct |
17 |
Correct |
6 ms |
14428 KB |
Output is correct |
18 |
Correct |
8 ms |
14428 KB |
Output is correct |
19 |
Correct |
8 ms |
14428 KB |
Output is correct |
20 |
Correct |
7 ms |
14428 KB |
Output is correct |
21 |
Correct |
7 ms |
14428 KB |
Output is correct |
22 |
Correct |
6 ms |
14428 KB |
Output is correct |
23 |
Correct |
6 ms |
14428 KB |
Output is correct |
24 |
Correct |
6 ms |
14428 KB |
Output is correct |
25 |
Correct |
6 ms |
14428 KB |
Output is correct |
26 |
Correct |
6 ms |
14428 KB |
Output is correct |
27 |
Correct |
6 ms |
14480 KB |
Output is correct |
28 |
Correct |
5 ms |
14428 KB |
Output is correct |
29 |
Correct |
5 ms |
14428 KB |
Output is correct |
30 |
Correct |
6 ms |
14424 KB |
Output is correct |
31 |
Correct |
6 ms |
14428 KB |
Output is correct |
32 |
Correct |
6 ms |
14428 KB |
Output is correct |
33 |
Correct |
6 ms |
14424 KB |
Output is correct |
34 |
Correct |
6 ms |
14428 KB |
Output is correct |
35 |
Correct |
5 ms |
14428 KB |
Output is correct |
36 |
Correct |
6 ms |
14428 KB |
Output is correct |
37 |
Correct |
6 ms |
14428 KB |
Output is correct |
38 |
Correct |
6 ms |
14428 KB |
Output is correct |
39 |
Correct |
5 ms |
14416 KB |
Output is correct |
40 |
Correct |
6 ms |
14428 KB |
Output is correct |
41 |
Correct |
7 ms |
14684 KB |
Output is correct |
42 |
Correct |
7 ms |
14424 KB |
Output is correct |
43 |
Correct |
5 ms |
14428 KB |
Output is correct |
44 |
Correct |
6 ms |
14424 KB |
Output is correct |
45 |
Correct |
6 ms |
14428 KB |
Output is correct |
46 |
Correct |
6 ms |
14536 KB |
Output is correct |
47 |
Correct |
6 ms |
14428 KB |
Output is correct |
48 |
Correct |
6 ms |
14424 KB |
Output is correct |
49 |
Correct |
5 ms |
14428 KB |
Output is correct |
50 |
Correct |
5 ms |
14428 KB |
Output is correct |
51 |
Correct |
5 ms |
14428 KB |
Output is correct |
52 |
Correct |
6 ms |
14424 KB |
Output is correct |
53 |
Correct |
5 ms |
14428 KB |
Output is correct |
54 |
Correct |
5 ms |
14424 KB |
Output is correct |
55 |
Correct |
7 ms |
14428 KB |
Output is correct |
56 |
Correct |
5 ms |
14428 KB |
Output is correct |
57 |
Correct |
6 ms |
14540 KB |
Output is correct |
58 |
Correct |
5 ms |
14428 KB |
Output is correct |
59 |
Correct |
6 ms |
14428 KB |
Output is correct |
60 |
Correct |
5 ms |
14428 KB |
Output is correct |
61 |
Correct |
5 ms |
14468 KB |
Output is correct |
62 |
Correct |
6 ms |
14428 KB |
Output is correct |
63 |
Correct |
5 ms |
14428 KB |
Output is correct |
64 |
Correct |
7 ms |
14428 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
14424 KB |
Output is correct |
2 |
Correct |
5 ms |
14428 KB |
Output is correct |
3 |
Correct |
5 ms |
14428 KB |
Output is correct |
4 |
Correct |
6 ms |
14536 KB |
Output is correct |
5 |
Correct |
6 ms |
14424 KB |
Output is correct |
6 |
Correct |
6 ms |
14428 KB |
Output is correct |
7 |
Correct |
5 ms |
14428 KB |
Output is correct |
8 |
Correct |
7 ms |
14444 KB |
Output is correct |
9 |
Correct |
6 ms |
14424 KB |
Output is correct |
10 |
Correct |
6 ms |
14428 KB |
Output is correct |
11 |
Correct |
8 ms |
14428 KB |
Output is correct |
12 |
Correct |
8 ms |
14428 KB |
Output is correct |
13 |
Correct |
7 ms |
14428 KB |
Output is correct |
14 |
Correct |
7 ms |
14428 KB |
Output is correct |
15 |
Correct |
6 ms |
14428 KB |
Output is correct |
16 |
Correct |
6 ms |
14428 KB |
Output is correct |
17 |
Correct |
6 ms |
14428 KB |
Output is correct |
18 |
Correct |
6 ms |
14428 KB |
Output is correct |
19 |
Correct |
6 ms |
14428 KB |
Output is correct |
20 |
Correct |
6 ms |
14480 KB |
Output is correct |
21 |
Correct |
5 ms |
14428 KB |
Output is correct |
22 |
Correct |
5 ms |
14428 KB |
Output is correct |
23 |
Correct |
6 ms |
14424 KB |
Output is correct |
24 |
Correct |
6 ms |
14428 KB |
Output is correct |
25 |
Correct |
6 ms |
14936 KB |
Output is correct |
26 |
Correct |
6 ms |
15060 KB |
Output is correct |
27 |
Correct |
8 ms |
15196 KB |
Output is correct |
28 |
Correct |
7 ms |
15192 KB |
Output is correct |
29 |
Correct |
7 ms |
14940 KB |
Output is correct |
30 |
Correct |
7 ms |
14940 KB |
Output is correct |
31 |
Correct |
9 ms |
14684 KB |
Output is correct |
32 |
Correct |
7 ms |
14680 KB |
Output is correct |
33 |
Correct |
8 ms |
14804 KB |
Output is correct |
34 |
Correct |
7 ms |
14680 KB |
Output is correct |
35 |
Correct |
8 ms |
14808 KB |
Output is correct |
36 |
Correct |
7 ms |
14684 KB |
Output is correct |
37 |
Correct |
6 ms |
14936 KB |
Output is correct |
38 |
Correct |
10 ms |
14940 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
14424 KB |
Output is correct |
2 |
Correct |
6 ms |
14424 KB |
Output is correct |
3 |
Correct |
5 ms |
14560 KB |
Output is correct |
4 |
Correct |
6 ms |
14424 KB |
Output is correct |
5 |
Correct |
5 ms |
14428 KB |
Output is correct |
6 |
Correct |
6 ms |
14428 KB |
Output is correct |
7 |
Correct |
6 ms |
14428 KB |
Output is correct |
8 |
Correct |
7 ms |
14424 KB |
Output is correct |
9 |
Correct |
6 ms |
14428 KB |
Output is correct |
10 |
Correct |
5 ms |
14428 KB |
Output is correct |
11 |
Correct |
6 ms |
14536 KB |
Output is correct |
12 |
Correct |
6 ms |
14424 KB |
Output is correct |
13 |
Correct |
6 ms |
14428 KB |
Output is correct |
14 |
Correct |
5 ms |
14428 KB |
Output is correct |
15 |
Correct |
7 ms |
14444 KB |
Output is correct |
16 |
Correct |
6 ms |
14424 KB |
Output is correct |
17 |
Correct |
6 ms |
14428 KB |
Output is correct |
18 |
Correct |
8 ms |
14428 KB |
Output is correct |
19 |
Correct |
8 ms |
14428 KB |
Output is correct |
20 |
Correct |
7 ms |
14428 KB |
Output is correct |
21 |
Correct |
7 ms |
14428 KB |
Output is correct |
22 |
Correct |
6 ms |
14428 KB |
Output is correct |
23 |
Correct |
6 ms |
14428 KB |
Output is correct |
24 |
Correct |
6 ms |
14428 KB |
Output is correct |
25 |
Correct |
6 ms |
14428 KB |
Output is correct |
26 |
Correct |
6 ms |
14428 KB |
Output is correct |
27 |
Correct |
6 ms |
14480 KB |
Output is correct |
28 |
Correct |
5 ms |
14428 KB |
Output is correct |
29 |
Correct |
5 ms |
14428 KB |
Output is correct |
30 |
Correct |
6 ms |
14424 KB |
Output is correct |
31 |
Correct |
6 ms |
14428 KB |
Output is correct |
32 |
Correct |
6 ms |
14428 KB |
Output is correct |
33 |
Correct |
6 ms |
14424 KB |
Output is correct |
34 |
Correct |
6 ms |
14428 KB |
Output is correct |
35 |
Correct |
5 ms |
14428 KB |
Output is correct |
36 |
Correct |
6 ms |
14428 KB |
Output is correct |
37 |
Correct |
6 ms |
14428 KB |
Output is correct |
38 |
Correct |
6 ms |
14428 KB |
Output is correct |
39 |
Correct |
5 ms |
14416 KB |
Output is correct |
40 |
Correct |
6 ms |
14428 KB |
Output is correct |
41 |
Correct |
7 ms |
14684 KB |
Output is correct |
42 |
Correct |
7 ms |
14940 KB |
Output is correct |
43 |
Correct |
6 ms |
15192 KB |
Output is correct |
44 |
Correct |
8 ms |
15768 KB |
Output is correct |
45 |
Correct |
7 ms |
15704 KB |
Output is correct |
46 |
Correct |
7 ms |
14424 KB |
Output is correct |
47 |
Correct |
5 ms |
14428 KB |
Output is correct |
48 |
Correct |
6 ms |
14424 KB |
Output is correct |
49 |
Correct |
6 ms |
14428 KB |
Output is correct |
50 |
Correct |
6 ms |
14536 KB |
Output is correct |
51 |
Correct |
6 ms |
14428 KB |
Output is correct |
52 |
Correct |
6 ms |
14424 KB |
Output is correct |
53 |
Correct |
5 ms |
14428 KB |
Output is correct |
54 |
Correct |
5 ms |
14428 KB |
Output is correct |
55 |
Correct |
5 ms |
14428 KB |
Output is correct |
56 |
Correct |
6 ms |
14684 KB |
Output is correct |
57 |
Correct |
6 ms |
14684 KB |
Output is correct |
58 |
Correct |
6 ms |
14548 KB |
Output is correct |
59 |
Correct |
7 ms |
14684 KB |
Output is correct |
60 |
Correct |
6 ms |
14424 KB |
Output is correct |
61 |
Correct |
5 ms |
14428 KB |
Output is correct |
62 |
Correct |
7 ms |
15068 KB |
Output is correct |
63 |
Correct |
7 ms |
14684 KB |
Output is correct |
64 |
Correct |
5 ms |
14424 KB |
Output is correct |
65 |
Correct |
7 ms |
14428 KB |
Output is correct |
66 |
Correct |
5 ms |
14428 KB |
Output is correct |
67 |
Correct |
6 ms |
14540 KB |
Output is correct |
68 |
Correct |
5 ms |
14428 KB |
Output is correct |
69 |
Correct |
6 ms |
14428 KB |
Output is correct |
70 |
Correct |
5 ms |
14428 KB |
Output is correct |
71 |
Correct |
5 ms |
14468 KB |
Output is correct |
72 |
Correct |
6 ms |
14428 KB |
Output is correct |
73 |
Correct |
5 ms |
14428 KB |
Output is correct |
74 |
Correct |
7 ms |
14428 KB |
Output is correct |
75 |
Correct |
6 ms |
14936 KB |
Output is correct |
76 |
Correct |
6 ms |
15060 KB |
Output is correct |
77 |
Correct |
8 ms |
15196 KB |
Output is correct |
78 |
Correct |
7 ms |
15192 KB |
Output is correct |
79 |
Correct |
7 ms |
14940 KB |
Output is correct |
80 |
Correct |
7 ms |
14940 KB |
Output is correct |
81 |
Correct |
9 ms |
14684 KB |
Output is correct |
82 |
Correct |
7 ms |
14680 KB |
Output is correct |
83 |
Correct |
8 ms |
14804 KB |
Output is correct |
84 |
Correct |
7 ms |
14680 KB |
Output is correct |
85 |
Correct |
8 ms |
14808 KB |
Output is correct |
86 |
Correct |
7 ms |
14684 KB |
Output is correct |
87 |
Correct |
6 ms |
14936 KB |
Output is correct |
88 |
Correct |
10 ms |
14940 KB |
Output is correct |
89 |
Correct |
6 ms |
14940 KB |
Output is correct |
90 |
Correct |
7 ms |
14952 KB |
Output is correct |
91 |
Correct |
7 ms |
14828 KB |
Output is correct |
92 |
Correct |
8 ms |
14784 KB |
Output is correct |
93 |
Correct |
7 ms |
14940 KB |
Output is correct |
94 |
Correct |
7 ms |
14684 KB |
Output is correct |
95 |
Correct |
7 ms |
14684 KB |
Output is correct |
96 |
Correct |
6 ms |
14952 KB |
Output is correct |
97 |
Correct |
6 ms |
14940 KB |
Output is correct |
98 |
Correct |
7 ms |
14940 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
14424 KB |
Output is correct |
2 |
Correct |
5 ms |
14428 KB |
Output is correct |
3 |
Correct |
5 ms |
14428 KB |
Output is correct |
4 |
Correct |
6 ms |
14536 KB |
Output is correct |
5 |
Correct |
6 ms |
14424 KB |
Output is correct |
6 |
Correct |
6 ms |
14428 KB |
Output is correct |
7 |
Correct |
5 ms |
14428 KB |
Output is correct |
8 |
Correct |
7 ms |
14444 KB |
Output is correct |
9 |
Correct |
6 ms |
14424 KB |
Output is correct |
10 |
Correct |
6 ms |
14428 KB |
Output is correct |
11 |
Correct |
8 ms |
14428 KB |
Output is correct |
12 |
Correct |
8 ms |
14428 KB |
Output is correct |
13 |
Correct |
7 ms |
14428 KB |
Output is correct |
14 |
Correct |
7 ms |
14428 KB |
Output is correct |
15 |
Correct |
6 ms |
14428 KB |
Output is correct |
16 |
Correct |
6 ms |
14428 KB |
Output is correct |
17 |
Correct |
6 ms |
14428 KB |
Output is correct |
18 |
Correct |
6 ms |
14428 KB |
Output is correct |
19 |
Correct |
6 ms |
14428 KB |
Output is correct |
20 |
Correct |
6 ms |
14480 KB |
Output is correct |
21 |
Correct |
5 ms |
14428 KB |
Output is correct |
22 |
Correct |
5 ms |
14428 KB |
Output is correct |
23 |
Correct |
6 ms |
14424 KB |
Output is correct |
24 |
Correct |
6 ms |
14428 KB |
Output is correct |
25 |
Correct |
6 ms |
14936 KB |
Output is correct |
26 |
Correct |
6 ms |
15060 KB |
Output is correct |
27 |
Correct |
8 ms |
15196 KB |
Output is correct |
28 |
Correct |
7 ms |
15192 KB |
Output is correct |
29 |
Correct |
7 ms |
14940 KB |
Output is correct |
30 |
Correct |
7 ms |
14940 KB |
Output is correct |
31 |
Correct |
9 ms |
14684 KB |
Output is correct |
32 |
Correct |
7 ms |
14680 KB |
Output is correct |
33 |
Correct |
8 ms |
14804 KB |
Output is correct |
34 |
Correct |
7 ms |
14680 KB |
Output is correct |
35 |
Correct |
8 ms |
14808 KB |
Output is correct |
36 |
Correct |
7 ms |
14684 KB |
Output is correct |
37 |
Correct |
6 ms |
14936 KB |
Output is correct |
38 |
Correct |
10 ms |
14940 KB |
Output is correct |
39 |
Correct |
123 ms |
78160 KB |
Output is correct |
40 |
Correct |
137 ms |
82156 KB |
Output is correct |
41 |
Correct |
143 ms |
83280 KB |
Output is correct |
42 |
Correct |
149 ms |
87632 KB |
Output is correct |
43 |
Correct |
137 ms |
68692 KB |
Output is correct |
44 |
Correct |
155 ms |
60496 KB |
Output is correct |
45 |
Correct |
336 ms |
47608 KB |
Output is correct |
46 |
Correct |
274 ms |
47356 KB |
Output is correct |
47 |
Correct |
214 ms |
48716 KB |
Output is correct |
48 |
Correct |
190 ms |
46400 KB |
Output is correct |
49 |
Correct |
153 ms |
46688 KB |
Output is correct |
50 |
Correct |
334 ms |
47304 KB |
Output is correct |
51 |
Correct |
288 ms |
44880 KB |
Output is correct |
52 |
Correct |
231 ms |
44884 KB |
Output is correct |
53 |
Correct |
175 ms |
44984 KB |
Output is correct |
54 |
Correct |
147 ms |
43860 KB |
Output is correct |
55 |
Correct |
120 ms |
54868 KB |
Output is correct |
56 |
Correct |
121 ms |
55396 KB |
Output is correct |
57 |
Correct |
128 ms |
45908 KB |
Output is correct |
58 |
Correct |
128 ms |
45140 KB |
Output is correct |
59 |
Correct |
123 ms |
44880 KB |
Output is correct |
60 |
Correct |
128 ms |
44784 KB |
Output is correct |
61 |
Correct |
149 ms |
44628 KB |
Output is correct |
62 |
Correct |
118 ms |
44624 KB |
Output is correct |
63 |
Correct |
153 ms |
56144 KB |
Output is correct |
64 |
Correct |
137 ms |
58192 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
14424 KB |
Output is correct |
2 |
Correct |
6 ms |
14424 KB |
Output is correct |
3 |
Correct |
5 ms |
14560 KB |
Output is correct |
4 |
Correct |
6 ms |
14424 KB |
Output is correct |
5 |
Correct |
5 ms |
14428 KB |
Output is correct |
6 |
Correct |
6 ms |
14428 KB |
Output is correct |
7 |
Correct |
6 ms |
14428 KB |
Output is correct |
8 |
Correct |
7 ms |
14424 KB |
Output is correct |
9 |
Correct |
6 ms |
14428 KB |
Output is correct |
10 |
Correct |
5 ms |
14428 KB |
Output is correct |
11 |
Correct |
6 ms |
14536 KB |
Output is correct |
12 |
Correct |
6 ms |
14424 KB |
Output is correct |
13 |
Correct |
6 ms |
14428 KB |
Output is correct |
14 |
Correct |
5 ms |
14428 KB |
Output is correct |
15 |
Correct |
7 ms |
14444 KB |
Output is correct |
16 |
Correct |
6 ms |
14424 KB |
Output is correct |
17 |
Correct |
6 ms |
14428 KB |
Output is correct |
18 |
Correct |
8 ms |
14428 KB |
Output is correct |
19 |
Correct |
8 ms |
14428 KB |
Output is correct |
20 |
Correct |
7 ms |
14428 KB |
Output is correct |
21 |
Correct |
7 ms |
14428 KB |
Output is correct |
22 |
Correct |
6 ms |
14428 KB |
Output is correct |
23 |
Correct |
6 ms |
14428 KB |
Output is correct |
24 |
Correct |
6 ms |
14428 KB |
Output is correct |
25 |
Correct |
6 ms |
14428 KB |
Output is correct |
26 |
Correct |
6 ms |
14428 KB |
Output is correct |
27 |
Correct |
6 ms |
14480 KB |
Output is correct |
28 |
Correct |
5 ms |
14428 KB |
Output is correct |
29 |
Correct |
5 ms |
14428 KB |
Output is correct |
30 |
Correct |
6 ms |
14424 KB |
Output is correct |
31 |
Correct |
6 ms |
14428 KB |
Output is correct |
32 |
Correct |
6 ms |
14428 KB |
Output is correct |
33 |
Correct |
6 ms |
14424 KB |
Output is correct |
34 |
Correct |
6 ms |
14428 KB |
Output is correct |
35 |
Correct |
5 ms |
14428 KB |
Output is correct |
36 |
Correct |
6 ms |
14428 KB |
Output is correct |
37 |
Correct |
6 ms |
14428 KB |
Output is correct |
38 |
Correct |
314 ms |
185040 KB |
Output is correct |
39 |
Correct |
279 ms |
188232 KB |
Output is correct |
40 |
Correct |
6 ms |
14428 KB |
Output is correct |
41 |
Correct |
5 ms |
14416 KB |
Output is correct |
42 |
Correct |
6 ms |
14428 KB |
Output is correct |
43 |
Correct |
7 ms |
14684 KB |
Output is correct |
44 |
Correct |
7 ms |
14940 KB |
Output is correct |
45 |
Correct |
6 ms |
15192 KB |
Output is correct |
46 |
Correct |
8 ms |
15768 KB |
Output is correct |
47 |
Correct |
7 ms |
15704 KB |
Output is correct |
48 |
Correct |
153 ms |
78924 KB |
Output is correct |
49 |
Correct |
163 ms |
82252 KB |
Output is correct |
50 |
Correct |
282 ms |
178000 KB |
Output is correct |
51 |
Correct |
291 ms |
186708 KB |
Output is correct |
52 |
Correct |
7 ms |
14424 KB |
Output is correct |
53 |
Correct |
5 ms |
14428 KB |
Output is correct |
54 |
Correct |
6 ms |
14424 KB |
Output is correct |
55 |
Correct |
6 ms |
14428 KB |
Output is correct |
56 |
Correct |
6 ms |
14536 KB |
Output is correct |
57 |
Correct |
6 ms |
14428 KB |
Output is correct |
58 |
Correct |
6 ms |
14424 KB |
Output is correct |
59 |
Correct |
5 ms |
14428 KB |
Output is correct |
60 |
Correct |
5 ms |
14428 KB |
Output is correct |
61 |
Correct |
5 ms |
14428 KB |
Output is correct |
62 |
Correct |
6 ms |
14684 KB |
Output is correct |
63 |
Correct |
6 ms |
14684 KB |
Output is correct |
64 |
Correct |
6 ms |
14548 KB |
Output is correct |
65 |
Correct |
7 ms |
14684 KB |
Output is correct |
66 |
Correct |
85 ms |
28716 KB |
Output is correct |
67 |
Correct |
71 ms |
28060 KB |
Output is correct |
68 |
Correct |
76 ms |
28276 KB |
Output is correct |
69 |
Correct |
76 ms |
28500 KB |
Output is correct |
70 |
Correct |
6 ms |
14424 KB |
Output is correct |
71 |
Correct |
5 ms |
14428 KB |
Output is correct |
72 |
Correct |
7 ms |
15068 KB |
Output is correct |
73 |
Correct |
7 ms |
14684 KB |
Output is correct |
74 |
Correct |
258 ms |
90440 KB |
Output is correct |
75 |
Correct |
146 ms |
41808 KB |
Output is correct |
76 |
Correct |
5 ms |
14424 KB |
Output is correct |
77 |
Correct |
7 ms |
14428 KB |
Output is correct |
78 |
Correct |
5 ms |
14428 KB |
Output is correct |
79 |
Correct |
6 ms |
14540 KB |
Output is correct |
80 |
Correct |
5 ms |
14428 KB |
Output is correct |
81 |
Correct |
6 ms |
14428 KB |
Output is correct |
82 |
Correct |
5 ms |
14428 KB |
Output is correct |
83 |
Correct |
5 ms |
14468 KB |
Output is correct |
84 |
Correct |
6 ms |
14428 KB |
Output is correct |
85 |
Correct |
5 ms |
14428 KB |
Output is correct |
86 |
Correct |
7 ms |
14428 KB |
Output is correct |
87 |
Correct |
6 ms |
14936 KB |
Output is correct |
88 |
Correct |
6 ms |
15060 KB |
Output is correct |
89 |
Correct |
8 ms |
15196 KB |
Output is correct |
90 |
Correct |
7 ms |
15192 KB |
Output is correct |
91 |
Correct |
7 ms |
14940 KB |
Output is correct |
92 |
Correct |
7 ms |
14940 KB |
Output is correct |
93 |
Correct |
9 ms |
14684 KB |
Output is correct |
94 |
Correct |
7 ms |
14680 KB |
Output is correct |
95 |
Correct |
8 ms |
14804 KB |
Output is correct |
96 |
Correct |
7 ms |
14680 KB |
Output is correct |
97 |
Correct |
8 ms |
14808 KB |
Output is correct |
98 |
Correct |
7 ms |
14684 KB |
Output is correct |
99 |
Correct |
6 ms |
14936 KB |
Output is correct |
100 |
Correct |
10 ms |
14940 KB |
Output is correct |
101 |
Correct |
6 ms |
14940 KB |
Output is correct |
102 |
Correct |
7 ms |
14952 KB |
Output is correct |
103 |
Correct |
7 ms |
14828 KB |
Output is correct |
104 |
Correct |
8 ms |
14784 KB |
Output is correct |
105 |
Correct |
7 ms |
14940 KB |
Output is correct |
106 |
Correct |
7 ms |
14684 KB |
Output is correct |
107 |
Correct |
7 ms |
14684 KB |
Output is correct |
108 |
Correct |
6 ms |
14952 KB |
Output is correct |
109 |
Correct |
6 ms |
14940 KB |
Output is correct |
110 |
Correct |
7 ms |
14940 KB |
Output is correct |
111 |
Correct |
123 ms |
78160 KB |
Output is correct |
112 |
Correct |
137 ms |
82156 KB |
Output is correct |
113 |
Correct |
143 ms |
83280 KB |
Output is correct |
114 |
Correct |
149 ms |
87632 KB |
Output is correct |
115 |
Correct |
137 ms |
68692 KB |
Output is correct |
116 |
Correct |
155 ms |
60496 KB |
Output is correct |
117 |
Correct |
336 ms |
47608 KB |
Output is correct |
118 |
Correct |
274 ms |
47356 KB |
Output is correct |
119 |
Correct |
214 ms |
48716 KB |
Output is correct |
120 |
Correct |
190 ms |
46400 KB |
Output is correct |
121 |
Correct |
153 ms |
46688 KB |
Output is correct |
122 |
Correct |
334 ms |
47304 KB |
Output is correct |
123 |
Correct |
288 ms |
44880 KB |
Output is correct |
124 |
Correct |
231 ms |
44884 KB |
Output is correct |
125 |
Correct |
175 ms |
44984 KB |
Output is correct |
126 |
Correct |
147 ms |
43860 KB |
Output is correct |
127 |
Correct |
120 ms |
54868 KB |
Output is correct |
128 |
Correct |
121 ms |
55396 KB |
Output is correct |
129 |
Correct |
128 ms |
45908 KB |
Output is correct |
130 |
Correct |
128 ms |
45140 KB |
Output is correct |
131 |
Correct |
123 ms |
44880 KB |
Output is correct |
132 |
Correct |
128 ms |
44784 KB |
Output is correct |
133 |
Correct |
149 ms |
44628 KB |
Output is correct |
134 |
Correct |
118 ms |
44624 KB |
Output is correct |
135 |
Correct |
153 ms |
56144 KB |
Output is correct |
136 |
Correct |
137 ms |
58192 KB |
Output is correct |
137 |
Correct |
140 ms |
62036 KB |
Output is correct |
138 |
Correct |
154 ms |
70012 KB |
Output is correct |
139 |
Correct |
317 ms |
46160 KB |
Output is correct |
140 |
Correct |
255 ms |
51792 KB |
Output is correct |
141 |
Correct |
275 ms |
78664 KB |
Output is correct |
142 |
Correct |
190 ms |
53840 KB |
Output is correct |
143 |
Correct |
182 ms |
59216 KB |
Output is correct |
144 |
Correct |
256 ms |
44116 KB |
Output is correct |
145 |
Correct |
237 ms |
48428 KB |
Output is correct |
146 |
Correct |
229 ms |
48432 KB |
Output is correct |
147 |
Correct |
283 ms |
77880 KB |
Output is correct |
148 |
Correct |
273 ms |
84808 KB |
Output is correct |
149 |
Correct |
121 ms |
55380 KB |
Output is correct |
150 |
Correct |
119 ms |
55376 KB |
Output is correct |
151 |
Correct |
131 ms |
47144 KB |
Output is correct |
152 |
Correct |
131 ms |
45848 KB |
Output is correct |
153 |
Correct |
151 ms |
45512 KB |
Output is correct |
154 |
Correct |
127 ms |
45644 KB |
Output is correct |
155 |
Correct |
126 ms |
45392 KB |
Output is correct |
156 |
Correct |
122 ms |
45480 KB |
Output is correct |
157 |
Correct |
147 ms |
57168 KB |
Output is correct |
158 |
Correct |
163 ms |
64856 KB |
Output is correct |