#include "beechtree.h"
#include <bits/stdc++.h>
using namespace std;
const int lim=200001,mxn=1e7+1;
int n,m,bad[lim],sz[lim],tin[lim],tout[lim],t,id,pos[lim],order[lim],root[lim][2],last[lim],cur,a[lim],b[lim];
int le[mxn],ri[mxn],st[mxn];
vector <int> p,c,res,ke[lim],ve[lim];
vector <pair <int, int>> ve2;
set <int> s[lim],sc[lim],tmp,C;
void dfs(int u){
sz[u]=1;
tin[u]=++t;
for (int v:ke[u]){
dfs(v);
sz[u]+=sz[v];
}
tout[u]=t;
ve[sz[u]].push_back(u);
}
int update(int node, int l, int r, int i){
cur++;
if (l==r){
st[cur]++;
return cur;
}
int tmp=cur,mid=(l+r)>>1;
le[tmp]=le[node];
ri[tmp]=ri[node];
if (mid<i)
ri[tmp]=update(ri[node],mid+1,r,i);
else
le[tmp]=update(le[node],l,mid,i);
st[tmp]=st[le[tmp]]+st[ri[tmp]];
return tmp;
}
int get(int node, int l, int r, int u, int v){
if (l>v||r<u||!node)
return 0;
if (l>=u&&r<=v)
return st[node];
int mid=(l+r)>>1;
return get(le[node],l,mid,u,v)+get(ri[node],mid+1,r,u,v);
}
int get(int i, int j, int k){
int res=get(root[i][k],1,n,tin[j],tout[j])-1;
return res-(k&&c[i]==c[j]);
}
void dfs2(int u){
if (ke[u].empty()){
s[u].insert(pos[u]);
return;
}
int mx=0,bigchild=-1;
for (int v:ke[u])
if (sz[v]>mx){
bigchild=v;
mx=sz[v];
}
for (int v:ke[u]){
dfs2(v);
bad[u]|=bad[v];
}
if (bad[u])
return;
swap(s[u],s[bigchild]);
s[u].insert(pos[u]);
for (int v:ke[u])
if (v!=bigchild)
for (int i:s[v]){
if (get(order[i],u,1)!=get(p[order[i]],u,0)){
bad[u]=1;
return;
}
}
if (get(bigchild,u,1)){
bad[u]=1;
return;
}
C.clear();
for (int v:ke[u])
if (v!=bigchild){
for (int i:s[v]){
s[u].insert(i);
tmp.insert(get(order[i],u,0));
sc[c[order[i]]].insert(get(order[i],u,1));
C.insert(c[order[i]]);
}
s[v].clear();
}
C.insert(c[bigchild]);
sc[c[bigchild]].insert(get(bigchild,u,1));
tmp.insert(0);
tmp.insert(sz[u]);
auto it=tmp.begin();
int last=-1;
ve2.clear();
while (it!=tmp.end()){
int x=(*it)-last-1;
if (x)
ve2.push_back({x,last});
last=*it;
it++;
}
tmp.clear();
int cnt=0;
for (int i:C){
int num=get(::last[i],1,n,tin[u],tout[u])-(c[u]==i);
int id=0;
pair <int, int> cur=ve2[0];
sc[i].insert(num);
auto it=sc[i].begin();
int last=-1;
while (it!=sc[i].end()){
int x=(*it)-last-1;
if (x){
cnt+=x;
if (!(x<=cur.first&&last==cur.second)){
bad[u]=1;
for (int i:C)
sc[i].clear();
return;
}
cur.first-=x;
if (!cur.first){
id++;
cur=(id==ve2.size()?make_pair(0,0):ve2[id]);
}
}
last=*it;
it++;
}
}
if (cnt<sz[bigchild]-1)
bad[u]=1;
for (int i:C)
sc[i].clear();
}
vector <int> beechtree(int N, int M, vector<int> P, vector<int> C){
n=N,m=M,p=P,c=C;
for (int i=1;i<n;i++)
ke[P[i]].push_back(i);
dfs(0);
for (int i=n;i>=0;i--){
sort(ve[i].begin(),ve[i].end(),[](int u, int v){return pos[p[u]]<pos[p[v]];});
for (int j:ve[i]){
pos[j]=++id;
order[id]=j;
}
}
for (int i=1;i<=n;i++){
int j=order[i];
root[j][0]=update(root[order[i-1]][0],1,n,tin[j]);
root[j][1]=update(last[c[j]],1,n,tin[j]);
last[c[j]]=root[j][1];
}
dfs2(0);
for (int i=0;i<n;i++)
res.push_back(bad[i]^1);
return res;
}
Compilation message
beechtree.cpp: In function 'void dfs2(int)':
beechtree.cpp:126:28: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
126 | cur=(id==ve2.size()?make_pair(0,0):ve2[id]);
| ~~^~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
10 ms |
33368 KB |
Output is correct |
2 |
Correct |
7 ms |
33368 KB |
Output is correct |
3 |
Correct |
7 ms |
33372 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
33372 KB |
Output is correct |
2 |
Correct |
7 ms |
33416 KB |
Output is correct |
3 |
Correct |
7 ms |
33372 KB |
Output is correct |
4 |
Correct |
7 ms |
33372 KB |
Output is correct |
5 |
Correct |
7 ms |
33372 KB |
Output is correct |
6 |
Correct |
7 ms |
33372 KB |
Output is correct |
7 |
Correct |
7 ms |
33644 KB |
Output is correct |
8 |
Correct |
8 ms |
33372 KB |
Output is correct |
9 |
Correct |
8 ms |
33372 KB |
Output is correct |
10 |
Correct |
7 ms |
33368 KB |
Output is correct |
11 |
Correct |
8 ms |
33368 KB |
Output is correct |
12 |
Correct |
8 ms |
33372 KB |
Output is correct |
13 |
Correct |
8 ms |
33372 KB |
Output is correct |
14 |
Correct |
7 ms |
33372 KB |
Output is correct |
15 |
Correct |
7 ms |
33372 KB |
Output is correct |
16 |
Correct |
7 ms |
33372 KB |
Output is correct |
17 |
Correct |
7 ms |
33452 KB |
Output is correct |
18 |
Correct |
8 ms |
33368 KB |
Output is correct |
19 |
Correct |
8 ms |
33372 KB |
Output is correct |
20 |
Correct |
8 ms |
33460 KB |
Output is correct |
21 |
Correct |
7 ms |
33372 KB |
Output is correct |
22 |
Correct |
7 ms |
33372 KB |
Output is correct |
23 |
Correct |
7 ms |
33372 KB |
Output is correct |
24 |
Correct |
7 ms |
33368 KB |
Output is correct |
25 |
Correct |
7 ms |
33372 KB |
Output is correct |
26 |
Correct |
7 ms |
33456 KB |
Output is correct |
27 |
Correct |
7 ms |
33372 KB |
Output is correct |
28 |
Correct |
7 ms |
33372 KB |
Output is correct |
29 |
Correct |
7 ms |
33372 KB |
Output is correct |
30 |
Correct |
7 ms |
33372 KB |
Output is correct |
31 |
Correct |
9 ms |
33476 KB |
Output is correct |
32 |
Correct |
7 ms |
33368 KB |
Output is correct |
33 |
Correct |
8 ms |
33372 KB |
Output is correct |
34 |
Correct |
7 ms |
33372 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
33372 KB |
Output is correct |
2 |
Correct |
7 ms |
33416 KB |
Output is correct |
3 |
Correct |
7 ms |
33372 KB |
Output is correct |
4 |
Correct |
7 ms |
33372 KB |
Output is correct |
5 |
Correct |
7 ms |
33372 KB |
Output is correct |
6 |
Correct |
7 ms |
33372 KB |
Output is correct |
7 |
Correct |
206 ms |
194508 KB |
Output is correct |
8 |
Correct |
176 ms |
194508 KB |
Output is correct |
9 |
Correct |
7 ms |
33368 KB |
Output is correct |
10 |
Correct |
7 ms |
33372 KB |
Output is correct |
11 |
Correct |
7 ms |
33368 KB |
Output is correct |
12 |
Correct |
7 ms |
33372 KB |
Output is correct |
13 |
Correct |
10 ms |
34652 KB |
Output is correct |
14 |
Correct |
10 ms |
34560 KB |
Output is correct |
15 |
Correct |
10 ms |
35160 KB |
Output is correct |
16 |
Correct |
9 ms |
35164 KB |
Output is correct |
17 |
Correct |
318 ms |
203156 KB |
Output is correct |
18 |
Correct |
282 ms |
199972 KB |
Output is correct |
19 |
Correct |
213 ms |
196000 KB |
Output is correct |
20 |
Correct |
196 ms |
194596 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
33372 KB |
Output is correct |
2 |
Correct |
8 ms |
33372 KB |
Output is correct |
3 |
Correct |
8 ms |
33372 KB |
Output is correct |
4 |
Correct |
8 ms |
33372 KB |
Output is correct |
5 |
Correct |
7 ms |
33372 KB |
Output is correct |
6 |
Correct |
8 ms |
33372 KB |
Output is correct |
7 |
Correct |
7 ms |
33372 KB |
Output is correct |
8 |
Correct |
8 ms |
33372 KB |
Output is correct |
9 |
Correct |
8 ms |
33460 KB |
Output is correct |
10 |
Correct |
8 ms |
33368 KB |
Output is correct |
11 |
Correct |
10 ms |
33884 KB |
Output is correct |
12 |
Correct |
9 ms |
33752 KB |
Output is correct |
13 |
Correct |
9 ms |
33884 KB |
Output is correct |
14 |
Correct |
9 ms |
33884 KB |
Output is correct |
15 |
Correct |
208 ms |
88252 KB |
Output is correct |
16 |
Correct |
214 ms |
87884 KB |
Output is correct |
17 |
Correct |
302 ms |
97312 KB |
Output is correct |
18 |
Correct |
328 ms |
97796 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
33372 KB |
Output is correct |
2 |
Correct |
7 ms |
33416 KB |
Output is correct |
3 |
Correct |
7 ms |
33644 KB |
Output is correct |
4 |
Correct |
8 ms |
33372 KB |
Output is correct |
5 |
Correct |
206 ms |
194508 KB |
Output is correct |
6 |
Correct |
176 ms |
194508 KB |
Output is correct |
7 |
Correct |
7 ms |
33372 KB |
Output is correct |
8 |
Correct |
8 ms |
33372 KB |
Output is correct |
9 |
Correct |
10 ms |
34652 KB |
Output is correct |
10 |
Correct |
10 ms |
34648 KB |
Output is correct |
11 |
Correct |
371 ms |
147612 KB |
Output is correct |
12 |
Correct |
327 ms |
135156 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
10 ms |
33368 KB |
Output is correct |
2 |
Correct |
7 ms |
33368 KB |
Output is correct |
3 |
Correct |
7 ms |
33372 KB |
Output is correct |
4 |
Correct |
7 ms |
33372 KB |
Output is correct |
5 |
Correct |
7 ms |
33416 KB |
Output is correct |
6 |
Correct |
7 ms |
33372 KB |
Output is correct |
7 |
Correct |
7 ms |
33372 KB |
Output is correct |
8 |
Correct |
7 ms |
33372 KB |
Output is correct |
9 |
Correct |
7 ms |
33372 KB |
Output is correct |
10 |
Correct |
7 ms |
33644 KB |
Output is correct |
11 |
Correct |
8 ms |
33372 KB |
Output is correct |
12 |
Correct |
8 ms |
33372 KB |
Output is correct |
13 |
Correct |
7 ms |
33368 KB |
Output is correct |
14 |
Correct |
8 ms |
33368 KB |
Output is correct |
15 |
Correct |
8 ms |
33372 KB |
Output is correct |
16 |
Correct |
8 ms |
33372 KB |
Output is correct |
17 |
Correct |
7 ms |
33372 KB |
Output is correct |
18 |
Correct |
7 ms |
33372 KB |
Output is correct |
19 |
Correct |
7 ms |
33372 KB |
Output is correct |
20 |
Correct |
7 ms |
33452 KB |
Output is correct |
21 |
Correct |
8 ms |
33368 KB |
Output is correct |
22 |
Correct |
8 ms |
33372 KB |
Output is correct |
23 |
Correct |
8 ms |
33460 KB |
Output is correct |
24 |
Correct |
7 ms |
33372 KB |
Output is correct |
25 |
Correct |
7 ms |
33372 KB |
Output is correct |
26 |
Correct |
7 ms |
33372 KB |
Output is correct |
27 |
Correct |
7 ms |
33368 KB |
Output is correct |
28 |
Correct |
7 ms |
33372 KB |
Output is correct |
29 |
Correct |
7 ms |
33456 KB |
Output is correct |
30 |
Correct |
7 ms |
33372 KB |
Output is correct |
31 |
Correct |
7 ms |
33372 KB |
Output is correct |
32 |
Correct |
7 ms |
33372 KB |
Output is correct |
33 |
Correct |
7 ms |
33372 KB |
Output is correct |
34 |
Correct |
9 ms |
33476 KB |
Output is correct |
35 |
Correct |
7 ms |
33368 KB |
Output is correct |
36 |
Correct |
8 ms |
33372 KB |
Output is correct |
37 |
Correct |
7 ms |
33372 KB |
Output is correct |
38 |
Correct |
7 ms |
33368 KB |
Output is correct |
39 |
Correct |
7 ms |
33372 KB |
Output is correct |
40 |
Correct |
7 ms |
33368 KB |
Output is correct |
41 |
Correct |
7 ms |
33372 KB |
Output is correct |
42 |
Correct |
8 ms |
33372 KB |
Output is correct |
43 |
Correct |
8 ms |
33372 KB |
Output is correct |
44 |
Correct |
8 ms |
33372 KB |
Output is correct |
45 |
Correct |
8 ms |
33372 KB |
Output is correct |
46 |
Correct |
7 ms |
33372 KB |
Output is correct |
47 |
Correct |
8 ms |
33372 KB |
Output is correct |
48 |
Correct |
7 ms |
33372 KB |
Output is correct |
49 |
Correct |
8 ms |
33372 KB |
Output is correct |
50 |
Correct |
8 ms |
33460 KB |
Output is correct |
51 |
Correct |
8 ms |
33368 KB |
Output is correct |
52 |
Correct |
7 ms |
33372 KB |
Output is correct |
53 |
Correct |
8 ms |
33372 KB |
Output is correct |
54 |
Correct |
7 ms |
33368 KB |
Output is correct |
55 |
Correct |
9 ms |
33372 KB |
Output is correct |
56 |
Correct |
7 ms |
33372 KB |
Output is correct |
57 |
Correct |
8 ms |
33372 KB |
Output is correct |
58 |
Correct |
8 ms |
33372 KB |
Output is correct |
59 |
Correct |
7 ms |
33372 KB |
Output is correct |
60 |
Correct |
8 ms |
33368 KB |
Output is correct |
61 |
Correct |
8 ms |
33368 KB |
Output is correct |
62 |
Correct |
8 ms |
33372 KB |
Output is correct |
63 |
Correct |
8 ms |
33372 KB |
Output is correct |
64 |
Correct |
7 ms |
33428 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
33372 KB |
Output is correct |
2 |
Correct |
7 ms |
33416 KB |
Output is correct |
3 |
Correct |
7 ms |
33644 KB |
Output is correct |
4 |
Correct |
8 ms |
33372 KB |
Output is correct |
5 |
Correct |
8 ms |
33372 KB |
Output is correct |
6 |
Correct |
7 ms |
33368 KB |
Output is correct |
7 |
Correct |
8 ms |
33368 KB |
Output is correct |
8 |
Correct |
8 ms |
33372 KB |
Output is correct |
9 |
Correct |
8 ms |
33372 KB |
Output is correct |
10 |
Correct |
7 ms |
33372 KB |
Output is correct |
11 |
Correct |
7 ms |
33372 KB |
Output is correct |
12 |
Correct |
7 ms |
33372 KB |
Output is correct |
13 |
Correct |
7 ms |
33452 KB |
Output is correct |
14 |
Correct |
8 ms |
33368 KB |
Output is correct |
15 |
Correct |
8 ms |
33372 KB |
Output is correct |
16 |
Correct |
8 ms |
33460 KB |
Output is correct |
17 |
Correct |
7 ms |
33372 KB |
Output is correct |
18 |
Correct |
7 ms |
33372 KB |
Output is correct |
19 |
Correct |
7 ms |
33372 KB |
Output is correct |
20 |
Correct |
7 ms |
33368 KB |
Output is correct |
21 |
Correct |
7 ms |
33372 KB |
Output is correct |
22 |
Correct |
7 ms |
33456 KB |
Output is correct |
23 |
Correct |
7 ms |
33372 KB |
Output is correct |
24 |
Correct |
7 ms |
33372 KB |
Output is correct |
25 |
Correct |
10 ms |
34652 KB |
Output is correct |
26 |
Correct |
9 ms |
34396 KB |
Output is correct |
27 |
Correct |
9 ms |
34392 KB |
Output is correct |
28 |
Correct |
9 ms |
34396 KB |
Output is correct |
29 |
Correct |
11 ms |
34516 KB |
Output is correct |
30 |
Correct |
10 ms |
34140 KB |
Output is correct |
31 |
Correct |
13 ms |
33988 KB |
Output is correct |
32 |
Correct |
12 ms |
33880 KB |
Output is correct |
33 |
Correct |
12 ms |
33884 KB |
Output is correct |
34 |
Correct |
15 ms |
34140 KB |
Output is correct |
35 |
Correct |
12 ms |
34024 KB |
Output is correct |
36 |
Correct |
10 ms |
33884 KB |
Output is correct |
37 |
Correct |
12 ms |
34236 KB |
Output is correct |
38 |
Correct |
9 ms |
34140 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
10 ms |
33368 KB |
Output is correct |
2 |
Correct |
7 ms |
33368 KB |
Output is correct |
3 |
Correct |
7 ms |
33372 KB |
Output is correct |
4 |
Correct |
7 ms |
33372 KB |
Output is correct |
5 |
Correct |
7 ms |
33416 KB |
Output is correct |
6 |
Correct |
7 ms |
33372 KB |
Output is correct |
7 |
Correct |
7 ms |
33372 KB |
Output is correct |
8 |
Correct |
7 ms |
33372 KB |
Output is correct |
9 |
Correct |
7 ms |
33372 KB |
Output is correct |
10 |
Correct |
7 ms |
33644 KB |
Output is correct |
11 |
Correct |
8 ms |
33372 KB |
Output is correct |
12 |
Correct |
8 ms |
33372 KB |
Output is correct |
13 |
Correct |
7 ms |
33368 KB |
Output is correct |
14 |
Correct |
8 ms |
33368 KB |
Output is correct |
15 |
Correct |
8 ms |
33372 KB |
Output is correct |
16 |
Correct |
8 ms |
33372 KB |
Output is correct |
17 |
Correct |
7 ms |
33372 KB |
Output is correct |
18 |
Correct |
7 ms |
33372 KB |
Output is correct |
19 |
Correct |
7 ms |
33372 KB |
Output is correct |
20 |
Correct |
7 ms |
33452 KB |
Output is correct |
21 |
Correct |
8 ms |
33368 KB |
Output is correct |
22 |
Correct |
8 ms |
33372 KB |
Output is correct |
23 |
Correct |
8 ms |
33460 KB |
Output is correct |
24 |
Correct |
7 ms |
33372 KB |
Output is correct |
25 |
Correct |
7 ms |
33372 KB |
Output is correct |
26 |
Correct |
7 ms |
33372 KB |
Output is correct |
27 |
Correct |
7 ms |
33368 KB |
Output is correct |
28 |
Correct |
7 ms |
33372 KB |
Output is correct |
29 |
Correct |
7 ms |
33456 KB |
Output is correct |
30 |
Correct |
7 ms |
33372 KB |
Output is correct |
31 |
Correct |
7 ms |
33372 KB |
Output is correct |
32 |
Correct |
7 ms |
33372 KB |
Output is correct |
33 |
Correct |
7 ms |
33372 KB |
Output is correct |
34 |
Correct |
9 ms |
33476 KB |
Output is correct |
35 |
Correct |
7 ms |
33368 KB |
Output is correct |
36 |
Correct |
8 ms |
33372 KB |
Output is correct |
37 |
Correct |
7 ms |
33372 KB |
Output is correct |
38 |
Correct |
7 ms |
33368 KB |
Output is correct |
39 |
Correct |
7 ms |
33372 KB |
Output is correct |
40 |
Correct |
7 ms |
33368 KB |
Output is correct |
41 |
Correct |
7 ms |
33372 KB |
Output is correct |
42 |
Correct |
10 ms |
34652 KB |
Output is correct |
43 |
Correct |
10 ms |
34560 KB |
Output is correct |
44 |
Correct |
10 ms |
35160 KB |
Output is correct |
45 |
Correct |
9 ms |
35164 KB |
Output is correct |
46 |
Correct |
8 ms |
33372 KB |
Output is correct |
47 |
Correct |
8 ms |
33372 KB |
Output is correct |
48 |
Correct |
8 ms |
33372 KB |
Output is correct |
49 |
Correct |
8 ms |
33372 KB |
Output is correct |
50 |
Correct |
7 ms |
33372 KB |
Output is correct |
51 |
Correct |
8 ms |
33372 KB |
Output is correct |
52 |
Correct |
7 ms |
33372 KB |
Output is correct |
53 |
Correct |
8 ms |
33372 KB |
Output is correct |
54 |
Correct |
8 ms |
33460 KB |
Output is correct |
55 |
Correct |
8 ms |
33368 KB |
Output is correct |
56 |
Correct |
10 ms |
33884 KB |
Output is correct |
57 |
Correct |
9 ms |
33752 KB |
Output is correct |
58 |
Correct |
9 ms |
33884 KB |
Output is correct |
59 |
Correct |
9 ms |
33884 KB |
Output is correct |
60 |
Correct |
7 ms |
33372 KB |
Output is correct |
61 |
Correct |
8 ms |
33372 KB |
Output is correct |
62 |
Correct |
10 ms |
34652 KB |
Output is correct |
63 |
Correct |
10 ms |
34648 KB |
Output is correct |
64 |
Correct |
7 ms |
33368 KB |
Output is correct |
65 |
Correct |
9 ms |
33372 KB |
Output is correct |
66 |
Correct |
7 ms |
33372 KB |
Output is correct |
67 |
Correct |
8 ms |
33372 KB |
Output is correct |
68 |
Correct |
8 ms |
33372 KB |
Output is correct |
69 |
Correct |
7 ms |
33372 KB |
Output is correct |
70 |
Correct |
8 ms |
33368 KB |
Output is correct |
71 |
Correct |
8 ms |
33368 KB |
Output is correct |
72 |
Correct |
8 ms |
33372 KB |
Output is correct |
73 |
Correct |
8 ms |
33372 KB |
Output is correct |
74 |
Correct |
7 ms |
33428 KB |
Output is correct |
75 |
Correct |
10 ms |
34652 KB |
Output is correct |
76 |
Correct |
9 ms |
34396 KB |
Output is correct |
77 |
Correct |
9 ms |
34392 KB |
Output is correct |
78 |
Correct |
9 ms |
34396 KB |
Output is correct |
79 |
Correct |
11 ms |
34516 KB |
Output is correct |
80 |
Correct |
10 ms |
34140 KB |
Output is correct |
81 |
Correct |
13 ms |
33988 KB |
Output is correct |
82 |
Correct |
12 ms |
33880 KB |
Output is correct |
83 |
Correct |
12 ms |
33884 KB |
Output is correct |
84 |
Correct |
15 ms |
34140 KB |
Output is correct |
85 |
Correct |
12 ms |
34024 KB |
Output is correct |
86 |
Correct |
10 ms |
33884 KB |
Output is correct |
87 |
Correct |
12 ms |
34236 KB |
Output is correct |
88 |
Correct |
9 ms |
34140 KB |
Output is correct |
89 |
Correct |
10 ms |
34396 KB |
Output is correct |
90 |
Correct |
10 ms |
34184 KB |
Output is correct |
91 |
Correct |
13 ms |
34136 KB |
Output is correct |
92 |
Correct |
12 ms |
34140 KB |
Output is correct |
93 |
Correct |
12 ms |
34392 KB |
Output is correct |
94 |
Correct |
13 ms |
34136 KB |
Output is correct |
95 |
Correct |
12 ms |
34140 KB |
Output is correct |
96 |
Correct |
11 ms |
34344 KB |
Output is correct |
97 |
Correct |
12 ms |
34140 KB |
Output is correct |
98 |
Correct |
9 ms |
34140 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
33372 KB |
Output is correct |
2 |
Correct |
7 ms |
33416 KB |
Output is correct |
3 |
Correct |
7 ms |
33644 KB |
Output is correct |
4 |
Correct |
8 ms |
33372 KB |
Output is correct |
5 |
Correct |
8 ms |
33372 KB |
Output is correct |
6 |
Correct |
7 ms |
33368 KB |
Output is correct |
7 |
Correct |
8 ms |
33368 KB |
Output is correct |
8 |
Correct |
8 ms |
33372 KB |
Output is correct |
9 |
Correct |
8 ms |
33372 KB |
Output is correct |
10 |
Correct |
7 ms |
33372 KB |
Output is correct |
11 |
Correct |
7 ms |
33372 KB |
Output is correct |
12 |
Correct |
7 ms |
33372 KB |
Output is correct |
13 |
Correct |
7 ms |
33452 KB |
Output is correct |
14 |
Correct |
8 ms |
33368 KB |
Output is correct |
15 |
Correct |
8 ms |
33372 KB |
Output is correct |
16 |
Correct |
8 ms |
33460 KB |
Output is correct |
17 |
Correct |
7 ms |
33372 KB |
Output is correct |
18 |
Correct |
7 ms |
33372 KB |
Output is correct |
19 |
Correct |
7 ms |
33372 KB |
Output is correct |
20 |
Correct |
7 ms |
33368 KB |
Output is correct |
21 |
Correct |
7 ms |
33372 KB |
Output is correct |
22 |
Correct |
7 ms |
33456 KB |
Output is correct |
23 |
Correct |
7 ms |
33372 KB |
Output is correct |
24 |
Correct |
7 ms |
33372 KB |
Output is correct |
25 |
Correct |
10 ms |
34652 KB |
Output is correct |
26 |
Correct |
9 ms |
34396 KB |
Output is correct |
27 |
Correct |
9 ms |
34392 KB |
Output is correct |
28 |
Correct |
9 ms |
34396 KB |
Output is correct |
29 |
Correct |
11 ms |
34516 KB |
Output is correct |
30 |
Correct |
10 ms |
34140 KB |
Output is correct |
31 |
Correct |
13 ms |
33988 KB |
Output is correct |
32 |
Correct |
12 ms |
33880 KB |
Output is correct |
33 |
Correct |
12 ms |
33884 KB |
Output is correct |
34 |
Correct |
15 ms |
34140 KB |
Output is correct |
35 |
Correct |
12 ms |
34024 KB |
Output is correct |
36 |
Correct |
10 ms |
33884 KB |
Output is correct |
37 |
Correct |
12 ms |
34236 KB |
Output is correct |
38 |
Correct |
9 ms |
34140 KB |
Output is correct |
39 |
Correct |
316 ms |
204132 KB |
Output is correct |
40 |
Correct |
255 ms |
200392 KB |
Output is correct |
41 |
Correct |
252 ms |
199040 KB |
Output is correct |
42 |
Correct |
175 ms |
194932 KB |
Output is correct |
43 |
Correct |
458 ms |
190260 KB |
Output is correct |
44 |
Correct |
480 ms |
156100 KB |
Output is correct |
45 |
Execution timed out |
2021 ms |
150576 KB |
Time limit exceeded |
46 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
10 ms |
33368 KB |
Output is correct |
2 |
Correct |
7 ms |
33368 KB |
Output is correct |
3 |
Correct |
7 ms |
33372 KB |
Output is correct |
4 |
Correct |
7 ms |
33372 KB |
Output is correct |
5 |
Correct |
7 ms |
33416 KB |
Output is correct |
6 |
Correct |
7 ms |
33372 KB |
Output is correct |
7 |
Correct |
7 ms |
33372 KB |
Output is correct |
8 |
Correct |
7 ms |
33372 KB |
Output is correct |
9 |
Correct |
7 ms |
33372 KB |
Output is correct |
10 |
Correct |
7 ms |
33644 KB |
Output is correct |
11 |
Correct |
8 ms |
33372 KB |
Output is correct |
12 |
Correct |
8 ms |
33372 KB |
Output is correct |
13 |
Correct |
7 ms |
33368 KB |
Output is correct |
14 |
Correct |
8 ms |
33368 KB |
Output is correct |
15 |
Correct |
8 ms |
33372 KB |
Output is correct |
16 |
Correct |
8 ms |
33372 KB |
Output is correct |
17 |
Correct |
7 ms |
33372 KB |
Output is correct |
18 |
Correct |
7 ms |
33372 KB |
Output is correct |
19 |
Correct |
7 ms |
33372 KB |
Output is correct |
20 |
Correct |
7 ms |
33452 KB |
Output is correct |
21 |
Correct |
8 ms |
33368 KB |
Output is correct |
22 |
Correct |
8 ms |
33372 KB |
Output is correct |
23 |
Correct |
8 ms |
33460 KB |
Output is correct |
24 |
Correct |
7 ms |
33372 KB |
Output is correct |
25 |
Correct |
7 ms |
33372 KB |
Output is correct |
26 |
Correct |
7 ms |
33372 KB |
Output is correct |
27 |
Correct |
7 ms |
33368 KB |
Output is correct |
28 |
Correct |
7 ms |
33372 KB |
Output is correct |
29 |
Correct |
7 ms |
33456 KB |
Output is correct |
30 |
Correct |
7 ms |
33372 KB |
Output is correct |
31 |
Correct |
7 ms |
33372 KB |
Output is correct |
32 |
Correct |
7 ms |
33372 KB |
Output is correct |
33 |
Correct |
7 ms |
33372 KB |
Output is correct |
34 |
Correct |
9 ms |
33476 KB |
Output is correct |
35 |
Correct |
7 ms |
33368 KB |
Output is correct |
36 |
Correct |
8 ms |
33372 KB |
Output is correct |
37 |
Correct |
7 ms |
33372 KB |
Output is correct |
38 |
Correct |
206 ms |
194508 KB |
Output is correct |
39 |
Correct |
176 ms |
194508 KB |
Output is correct |
40 |
Correct |
7 ms |
33368 KB |
Output is correct |
41 |
Correct |
7 ms |
33372 KB |
Output is correct |
42 |
Correct |
7 ms |
33368 KB |
Output is correct |
43 |
Correct |
7 ms |
33372 KB |
Output is correct |
44 |
Correct |
10 ms |
34652 KB |
Output is correct |
45 |
Correct |
10 ms |
34560 KB |
Output is correct |
46 |
Correct |
10 ms |
35160 KB |
Output is correct |
47 |
Correct |
9 ms |
35164 KB |
Output is correct |
48 |
Correct |
318 ms |
203156 KB |
Output is correct |
49 |
Correct |
282 ms |
199972 KB |
Output is correct |
50 |
Correct |
213 ms |
196000 KB |
Output is correct |
51 |
Correct |
196 ms |
194596 KB |
Output is correct |
52 |
Correct |
8 ms |
33372 KB |
Output is correct |
53 |
Correct |
8 ms |
33372 KB |
Output is correct |
54 |
Correct |
8 ms |
33372 KB |
Output is correct |
55 |
Correct |
8 ms |
33372 KB |
Output is correct |
56 |
Correct |
7 ms |
33372 KB |
Output is correct |
57 |
Correct |
8 ms |
33372 KB |
Output is correct |
58 |
Correct |
7 ms |
33372 KB |
Output is correct |
59 |
Correct |
8 ms |
33372 KB |
Output is correct |
60 |
Correct |
8 ms |
33460 KB |
Output is correct |
61 |
Correct |
8 ms |
33368 KB |
Output is correct |
62 |
Correct |
10 ms |
33884 KB |
Output is correct |
63 |
Correct |
9 ms |
33752 KB |
Output is correct |
64 |
Correct |
9 ms |
33884 KB |
Output is correct |
65 |
Correct |
9 ms |
33884 KB |
Output is correct |
66 |
Correct |
208 ms |
88252 KB |
Output is correct |
67 |
Correct |
214 ms |
87884 KB |
Output is correct |
68 |
Correct |
302 ms |
97312 KB |
Output is correct |
69 |
Correct |
328 ms |
97796 KB |
Output is correct |
70 |
Correct |
7 ms |
33372 KB |
Output is correct |
71 |
Correct |
8 ms |
33372 KB |
Output is correct |
72 |
Correct |
10 ms |
34652 KB |
Output is correct |
73 |
Correct |
10 ms |
34648 KB |
Output is correct |
74 |
Correct |
371 ms |
147612 KB |
Output is correct |
75 |
Correct |
327 ms |
135156 KB |
Output is correct |
76 |
Correct |
7 ms |
33368 KB |
Output is correct |
77 |
Correct |
9 ms |
33372 KB |
Output is correct |
78 |
Correct |
7 ms |
33372 KB |
Output is correct |
79 |
Correct |
8 ms |
33372 KB |
Output is correct |
80 |
Correct |
8 ms |
33372 KB |
Output is correct |
81 |
Correct |
7 ms |
33372 KB |
Output is correct |
82 |
Correct |
8 ms |
33368 KB |
Output is correct |
83 |
Correct |
8 ms |
33368 KB |
Output is correct |
84 |
Correct |
8 ms |
33372 KB |
Output is correct |
85 |
Correct |
8 ms |
33372 KB |
Output is correct |
86 |
Correct |
7 ms |
33428 KB |
Output is correct |
87 |
Correct |
10 ms |
34652 KB |
Output is correct |
88 |
Correct |
9 ms |
34396 KB |
Output is correct |
89 |
Correct |
9 ms |
34392 KB |
Output is correct |
90 |
Correct |
9 ms |
34396 KB |
Output is correct |
91 |
Correct |
11 ms |
34516 KB |
Output is correct |
92 |
Correct |
10 ms |
34140 KB |
Output is correct |
93 |
Correct |
13 ms |
33988 KB |
Output is correct |
94 |
Correct |
12 ms |
33880 KB |
Output is correct |
95 |
Correct |
12 ms |
33884 KB |
Output is correct |
96 |
Correct |
15 ms |
34140 KB |
Output is correct |
97 |
Correct |
12 ms |
34024 KB |
Output is correct |
98 |
Correct |
10 ms |
33884 KB |
Output is correct |
99 |
Correct |
12 ms |
34236 KB |
Output is correct |
100 |
Correct |
9 ms |
34140 KB |
Output is correct |
101 |
Correct |
10 ms |
34396 KB |
Output is correct |
102 |
Correct |
10 ms |
34184 KB |
Output is correct |
103 |
Correct |
13 ms |
34136 KB |
Output is correct |
104 |
Correct |
12 ms |
34140 KB |
Output is correct |
105 |
Correct |
12 ms |
34392 KB |
Output is correct |
106 |
Correct |
13 ms |
34136 KB |
Output is correct |
107 |
Correct |
12 ms |
34140 KB |
Output is correct |
108 |
Correct |
11 ms |
34344 KB |
Output is correct |
109 |
Correct |
12 ms |
34140 KB |
Output is correct |
110 |
Correct |
9 ms |
34140 KB |
Output is correct |
111 |
Correct |
316 ms |
204132 KB |
Output is correct |
112 |
Correct |
255 ms |
200392 KB |
Output is correct |
113 |
Correct |
252 ms |
199040 KB |
Output is correct |
114 |
Correct |
175 ms |
194932 KB |
Output is correct |
115 |
Correct |
458 ms |
190260 KB |
Output is correct |
116 |
Correct |
480 ms |
156100 KB |
Output is correct |
117 |
Execution timed out |
2021 ms |
150576 KB |
Time limit exceeded |
118 |
Halted |
0 ms |
0 KB |
- |