#include <bits/stdc++.h>
using namespace std;
typedef long long llo;
#define a first
#define b second
#define pb push_back
#define endl '\n'
const llo mod=1e9+7;
int q;
int ee;
vector<int> adj[200001];
int cc[200001];
int dd[200001];
int vis[200001];
vector<int> ss;
vector<int> tt;
vector<int> pre[200001];
map<int,int> ind[200001];
int ind2[200001];
int ind3[200001];
vector<int> adj2[200001*40];
int vis2[200001*40];
int vis3[200001*40];
void dfs(int no,int par2=-1){
ss.pb(no);
if(ee==no){
tt=ss;
}
for(auto j:adj[no]){
if(j!=par2){
dfs(j,no);
}
}
ss.pop_back();
}
int stt=1;
void dfs2(int no){
vis2[no]=1;
vis3[no]=1;
for(auto j:adj2[no]){
assert(j!=-1);
if(j==-1){
continue;
}
if(vis3[j]==1){
stt=0;
}
if(vis2[j]==0){
dfs2(j);
}
}
vis3[no]=0;
}
int par[120001][20];
int pp[120001][20];
int pp2[120001][20];
int up[120001];
int lev[120001];
void dfs3(int no,int par2=-1,int xx=-1,int levv=0){
par[no][0]=par2;
up[no]=xx;
lev[no]=levv;
if(ind2[no]>=0 or ind3[no]>=0){
xx=no;
}
for(auto j:adj[no]){
if(j!=par2){
dfs3(j,no,xx,levv+1);
}
}
}
int lca(int aa,int bb){
if(lev[bb]<lev[aa]){
swap(aa,bb);
}
//cout<<lev[bb]<<",,"<<lev[aa]<<endl;
int dif=lev[bb]-lev[aa];
//cout<<dif<<",,"<<endl;
for(int j=19;j>=0;j--){
if((1<<j)&dif){
bb=par[bb][j];
}
}
/* cout<<bb<<",,"<<par[bb][0]<<endl;
cout<<dif<<",,"<<endl;
cout<<aa<<",,"<<bb<<endl;*/
if(aa==bb){
return aa;
}
for(int j=19;j>=0;j--){
if(par[aa][j]!=par[bb][j]){
aa=par[aa][j];
bb=par[bb][j];
}
}
return par[aa][0];
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin>>q;
while(q--){
int n;
cin>>n;
for(int i=0;i<n;i++){
adj[i].clear();
}
for(int i=0;i<n*50;i++){
adj2[i].clear();
}
for(int i=0;i<n-1;i++){
int aa,bb;
cin>>aa>>bb;
aa--;
bb--;
adj[aa].pb(bb);
adj[bb].pb(aa);
}
int m;
cin>>m;
stt=1;
for(int i=0;i<n;i++){
ind2[i]=-1;
ind3[i]=-1;
}
for(int i=0;i<m;i++){
cin>>cc[i]>>dd[i];
ind[i].clear();
cc[i]--;
dd[i]--;
ind2[dd[i]]=i;
ind3[cc[i]]=i;
ee=dd[i];
/* dfs(cc[i]);
pre[i]=tt;
for(auto j:tt){
ind[i][j]++;
}*/
}
dfs3(0);
for(int j=1;j<20;j++){
for(int i=0;i<n;i++){
if(par[i][j-1]==-1){
par[i][j]=-1;
}
else{
par[i][j]=par[par[i][j-1]][j-1];
}
}
}
int ind6=m;
for(int j=0;j<20;j++){
for(int i=0;i<n;i++){
if(par[i][j]==-1){
pp[i][j]=-1;
continue;
}
ind6++;
pp[i][j]=ind6;
if(j>0){
adj2[pp[i][j]].pb(pp[i][j-1]);
adj2[pp[i][j]].pb(pp[par[i][j-1]][j-1]);
}
}
}
for(int j=0;j<20;j++){
for(int i=0;i<n;i++){
if(par[i][j]==-1){
pp2[i][j]=-1;
continue;
}
ind6++;
pp2[i][j]=ind6;
if(j>0){
adj2[pp2[i][j-1]].pb(pp2[i][j]);
adj2[pp2[par[i][j-1]][j-1]].pb(pp2[i][j]);
}
}
}
for(int i=1;i<n;i++){
if(ind2[i]>=0){
adj2[pp[i][0]].pb(ind2[i]);
}
if(ind3[i]>=0){
adj2[ind3[i]].pb(pp2[i][0]);
}
}
for(int i=0;i<ind6;i++){
for(auto j:adj2[i]){
assert(j!=-1);
}
}
/* for(int i=0;i<ind6;i++){
adj2[i].clear();
}*/
for(int i=0;i<m;i++){
int x=lca(cc[i],dd[i]);
/// cout<<cc[i]<<":"<<dd[i]<<":"<<x<<endl;
int j=par[cc[i]][0];
if(x!=cc[i] and lev[j]>lev[x]){
int dif=lev[j]-lev[x];
for(int jj=19;jj>=0;jj--){
if((1<<jj)&dif){
adj2[i].pb(pp[j][jj]);
adj2[pp2[j][jj]].pb(i);
j=par[j][jj];
}
}
}
j=par[dd[i]][0];
if(x!=dd[i] and lev[j]>lev[x]){
int dif=lev[j]-lev[x];
for(int jj=19;jj>=0;jj--){
if((1<<jj)&dif){
adj2[i].pb(pp[j][jj]);
adj2[pp2[j][jj]].pb(i);
j=par[j][jj];
}
}
}
vector<int> tte;
tte.pb(cc[i]);
tte.pb(dd[i]);
tte.pb(x);
for(auto j:tte){
if(ind2[j]>=0 and ind2[j]!=i){
adj2[i].pb(ind2[j]);
//cout<<i<<":"<<ind3[j]<<endl;
}
if(ind3[j]>=0 and ind3[j]!=i){
adj2[ind3[j]].pb(i);
//cout<<ind2[j]<<":"<<i<<endl;
}
}
/*while(j!=-1){
if(lev[j]<lev[x]){
break;
}
if(ind3[j]>=0 and ind3[j]!=i){
adj2[i].pb(ind3[j]);
//cout<<i<<":"<<ind3[j]<<endl;
}
if(ind2[j]>=0 and ind2[j]!=i){
adj2[ind2[j]].pb(i);
//cout<<ind2[j]<<":"<<i<<endl;
}
j=up[j];
}
j=dd[i];
while(j!=-1){
if(lev[j]<lev[x]){
break;
}
if(ind3[j]>=0 and ind3[j]!=i){
adj2[i].pb(ind3[j]);
//cout<<i<<":"<<ind3[j]<<endl;
}
if(ind2[j]>=0 and ind2[j]!=i){
adj2[ind2[j]].pb(i);
//cout<<ind2[j]<<":"<<i<<endl;
}
j=up[j];
}*/
//cout<<endl;
/* for(auto j:pre[i]){
if(ind3[j]>=0 and ind3[j]!=i){
adj2[i].pb(ind3[j]);
//cout<<i<<":"<<ind3[j]<<endl;
}
if(ind2[j]>=0 and ind2[j]!=i){
adj2[ind2[j]].pb(i);
// cout<<ind2[j]<<":"<<i<<endl;
}
}*/
}
for(int i=0;i<ind6;i++){
vis2[i]=0;
}
for(int i=0;i<ind6;i++){
/*for(auto j:adj2[i]){
cout<<i<<","<<j<<endl;
}*/
if(vis2[i]==0){
dfs2(i);
}
}
if(stt==0){
cout<<"No"<<endl;
}
else{
cout<<"Yes"<<endl;
}
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
103 ms |
206924 KB |
Output is correct |
2 |
Correct |
96 ms |
206924 KB |
Output is correct |
3 |
Correct |
93 ms |
206912 KB |
Output is correct |
4 |
Correct |
129 ms |
207196 KB |
Output is correct |
5 |
Correct |
172 ms |
207124 KB |
Output is correct |
6 |
Correct |
102 ms |
207308 KB |
Output is correct |
7 |
Correct |
97 ms |
207172 KB |
Output is correct |
8 |
Correct |
100 ms |
207204 KB |
Output is correct |
9 |
Correct |
277 ms |
214876 KB |
Output is correct |
10 |
Correct |
649 ms |
392400 KB |
Output is correct |
11 |
Correct |
115 ms |
207172 KB |
Output is correct |
12 |
Correct |
172 ms |
207256 KB |
Output is correct |
13 |
Correct |
611 ms |
397604 KB |
Output is correct |
14 |
Correct |
708 ms |
397744 KB |
Output is correct |
15 |
Correct |
1412 ms |
427732 KB |
Output is correct |
16 |
Correct |
2064 ms |
486844 KB |
Output is correct |
17 |
Correct |
698 ms |
402592 KB |
Output is correct |
18 |
Correct |
857 ms |
404428 KB |
Output is correct |
19 |
Correct |
667 ms |
402008 KB |
Output is correct |
20 |
Correct |
678 ms |
401896 KB |
Output is correct |
21 |
Correct |
974 ms |
429208 KB |
Output is correct |
22 |
Correct |
766 ms |
398964 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
95 ms |
206944 KB |
Output is correct |
2 |
Correct |
110 ms |
206940 KB |
Output is correct |
3 |
Correct |
105 ms |
207172 KB |
Output is correct |
4 |
Correct |
110 ms |
207160 KB |
Output is correct |
5 |
Correct |
109 ms |
207204 KB |
Output is correct |
6 |
Correct |
99 ms |
207212 KB |
Output is correct |
7 |
Correct |
96 ms |
207180 KB |
Output is correct |
8 |
Correct |
102 ms |
207132 KB |
Output is correct |
9 |
Correct |
113 ms |
207188 KB |
Output is correct |
10 |
Correct |
98 ms |
207156 KB |
Output is correct |
11 |
Correct |
96 ms |
207176 KB |
Output is correct |
12 |
Correct |
97 ms |
207052 KB |
Output is correct |
13 |
Correct |
120 ms |
207044 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
95 ms |
206944 KB |
Output is correct |
2 |
Correct |
110 ms |
206940 KB |
Output is correct |
3 |
Correct |
105 ms |
207172 KB |
Output is correct |
4 |
Correct |
110 ms |
207160 KB |
Output is correct |
5 |
Correct |
109 ms |
207204 KB |
Output is correct |
6 |
Correct |
99 ms |
207212 KB |
Output is correct |
7 |
Correct |
96 ms |
207180 KB |
Output is correct |
8 |
Correct |
102 ms |
207132 KB |
Output is correct |
9 |
Correct |
113 ms |
207188 KB |
Output is correct |
10 |
Correct |
98 ms |
207156 KB |
Output is correct |
11 |
Correct |
96 ms |
207176 KB |
Output is correct |
12 |
Correct |
97 ms |
207052 KB |
Output is correct |
13 |
Correct |
120 ms |
207044 KB |
Output is correct |
14 |
Correct |
100 ms |
207016 KB |
Output is correct |
15 |
Correct |
93 ms |
206976 KB |
Output is correct |
16 |
Correct |
99 ms |
207232 KB |
Output is correct |
17 |
Correct |
98 ms |
207052 KB |
Output is correct |
18 |
Correct |
101 ms |
207180 KB |
Output is correct |
19 |
Correct |
98 ms |
206996 KB |
Output is correct |
20 |
Correct |
108 ms |
207164 KB |
Output is correct |
21 |
Correct |
101 ms |
207160 KB |
Output is correct |
22 |
Correct |
103 ms |
207108 KB |
Output is correct |
23 |
Correct |
95 ms |
206920 KB |
Output is correct |
24 |
Correct |
94 ms |
207080 KB |
Output is correct |
25 |
Correct |
96 ms |
207192 KB |
Output is correct |
26 |
Correct |
101 ms |
207180 KB |
Output is correct |
27 |
Correct |
105 ms |
207064 KB |
Output is correct |
28 |
Correct |
96 ms |
207016 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
95 ms |
206944 KB |
Output is correct |
2 |
Correct |
110 ms |
206940 KB |
Output is correct |
3 |
Correct |
105 ms |
207172 KB |
Output is correct |
4 |
Correct |
110 ms |
207160 KB |
Output is correct |
5 |
Correct |
109 ms |
207204 KB |
Output is correct |
6 |
Correct |
99 ms |
207212 KB |
Output is correct |
7 |
Correct |
96 ms |
207180 KB |
Output is correct |
8 |
Correct |
102 ms |
207132 KB |
Output is correct |
9 |
Correct |
113 ms |
207188 KB |
Output is correct |
10 |
Correct |
98 ms |
207156 KB |
Output is correct |
11 |
Correct |
96 ms |
207176 KB |
Output is correct |
12 |
Correct |
97 ms |
207052 KB |
Output is correct |
13 |
Correct |
120 ms |
207044 KB |
Output is correct |
14 |
Correct |
100 ms |
207016 KB |
Output is correct |
15 |
Correct |
93 ms |
206976 KB |
Output is correct |
16 |
Correct |
99 ms |
207232 KB |
Output is correct |
17 |
Correct |
98 ms |
207052 KB |
Output is correct |
18 |
Correct |
101 ms |
207180 KB |
Output is correct |
19 |
Correct |
98 ms |
206996 KB |
Output is correct |
20 |
Correct |
108 ms |
207164 KB |
Output is correct |
21 |
Correct |
101 ms |
207160 KB |
Output is correct |
22 |
Correct |
103 ms |
207108 KB |
Output is correct |
23 |
Correct |
95 ms |
206920 KB |
Output is correct |
24 |
Correct |
94 ms |
207080 KB |
Output is correct |
25 |
Correct |
96 ms |
207192 KB |
Output is correct |
26 |
Correct |
101 ms |
207180 KB |
Output is correct |
27 |
Correct |
105 ms |
207064 KB |
Output is correct |
28 |
Correct |
96 ms |
207016 KB |
Output is correct |
29 |
Correct |
101 ms |
207272 KB |
Output is correct |
30 |
Correct |
105 ms |
207172 KB |
Output is correct |
31 |
Correct |
108 ms |
207212 KB |
Output is correct |
32 |
Correct |
100 ms |
207156 KB |
Output is correct |
33 |
Correct |
102 ms |
207288 KB |
Output is correct |
34 |
Correct |
120 ms |
207080 KB |
Output is correct |
35 |
Correct |
117 ms |
207152 KB |
Output is correct |
36 |
Correct |
94 ms |
207100 KB |
Output is correct |
37 |
Correct |
95 ms |
207088 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
95 ms |
206944 KB |
Output is correct |
2 |
Correct |
110 ms |
206940 KB |
Output is correct |
3 |
Correct |
105 ms |
207172 KB |
Output is correct |
4 |
Correct |
110 ms |
207160 KB |
Output is correct |
5 |
Correct |
109 ms |
207204 KB |
Output is correct |
6 |
Correct |
99 ms |
207212 KB |
Output is correct |
7 |
Correct |
96 ms |
207180 KB |
Output is correct |
8 |
Correct |
102 ms |
207132 KB |
Output is correct |
9 |
Correct |
113 ms |
207188 KB |
Output is correct |
10 |
Correct |
98 ms |
207156 KB |
Output is correct |
11 |
Correct |
96 ms |
207176 KB |
Output is correct |
12 |
Correct |
97 ms |
207052 KB |
Output is correct |
13 |
Correct |
120 ms |
207044 KB |
Output is correct |
14 |
Correct |
100 ms |
207016 KB |
Output is correct |
15 |
Correct |
93 ms |
206976 KB |
Output is correct |
16 |
Correct |
99 ms |
207232 KB |
Output is correct |
17 |
Correct |
98 ms |
207052 KB |
Output is correct |
18 |
Correct |
101 ms |
207180 KB |
Output is correct |
19 |
Correct |
98 ms |
206996 KB |
Output is correct |
20 |
Correct |
108 ms |
207164 KB |
Output is correct |
21 |
Correct |
101 ms |
207160 KB |
Output is correct |
22 |
Correct |
103 ms |
207108 KB |
Output is correct |
23 |
Correct |
95 ms |
206920 KB |
Output is correct |
24 |
Correct |
94 ms |
207080 KB |
Output is correct |
25 |
Correct |
96 ms |
207192 KB |
Output is correct |
26 |
Correct |
101 ms |
207180 KB |
Output is correct |
27 |
Correct |
105 ms |
207064 KB |
Output is correct |
28 |
Correct |
96 ms |
207016 KB |
Output is correct |
29 |
Correct |
101 ms |
207272 KB |
Output is correct |
30 |
Correct |
105 ms |
207172 KB |
Output is correct |
31 |
Correct |
108 ms |
207212 KB |
Output is correct |
32 |
Correct |
100 ms |
207156 KB |
Output is correct |
33 |
Correct |
102 ms |
207288 KB |
Output is correct |
34 |
Correct |
120 ms |
207080 KB |
Output is correct |
35 |
Correct |
117 ms |
207152 KB |
Output is correct |
36 |
Correct |
94 ms |
207100 KB |
Output is correct |
37 |
Correct |
95 ms |
207088 KB |
Output is correct |
38 |
Correct |
287 ms |
214428 KB |
Output is correct |
39 |
Correct |
645 ms |
392396 KB |
Output is correct |
40 |
Correct |
280 ms |
214740 KB |
Output is correct |
41 |
Correct |
184 ms |
210956 KB |
Output is correct |
42 |
Correct |
189 ms |
212364 KB |
Output is correct |
43 |
Correct |
244 ms |
214256 KB |
Output is correct |
44 |
Correct |
117 ms |
207696 KB |
Output is correct |
45 |
Correct |
417 ms |
294480 KB |
Output is correct |
46 |
Correct |
432 ms |
294660 KB |
Output is correct |
47 |
Correct |
643 ms |
378328 KB |
Output is correct |
48 |
Correct |
648 ms |
378332 KB |
Output is correct |
49 |
Correct |
490 ms |
335696 KB |
Output is correct |
50 |
Correct |
483 ms |
335880 KB |
Output is correct |
51 |
Correct |
535 ms |
364496 KB |
Output is correct |
52 |
Correct |
549 ms |
364764 KB |
Output is correct |
53 |
Correct |
124 ms |
212556 KB |
Output is correct |
54 |
Correct |
471 ms |
284484 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
105 ms |
206980 KB |
Output is correct |
2 |
Correct |
120 ms |
206992 KB |
Output is correct |
3 |
Correct |
108 ms |
206960 KB |
Output is correct |
4 |
Correct |
97 ms |
206956 KB |
Output is correct |
5 |
Correct |
108 ms |
207004 KB |
Output is correct |
6 |
Correct |
98 ms |
207056 KB |
Output is correct |
7 |
Correct |
97 ms |
207072 KB |
Output is correct |
8 |
Correct |
103 ms |
207032 KB |
Output is correct |
9 |
Correct |
110 ms |
207016 KB |
Output is correct |
10 |
Correct |
98 ms |
206988 KB |
Output is correct |
11 |
Correct |
94 ms |
206984 KB |
Output is correct |
12 |
Correct |
102 ms |
207156 KB |
Output is correct |
13 |
Correct |
138 ms |
207164 KB |
Output is correct |
14 |
Correct |
159 ms |
207068 KB |
Output is correct |
15 |
Correct |
140 ms |
207048 KB |
Output is correct |
16 |
Correct |
386 ms |
271620 KB |
Output is correct |
17 |
Correct |
585 ms |
282748 KB |
Output is correct |
18 |
Correct |
844 ms |
302532 KB |
Output is correct |
19 |
Correct |
443 ms |
273364 KB |
Output is correct |
20 |
Correct |
412 ms |
272276 KB |
Output is correct |
21 |
Correct |
403 ms |
272620 KB |
Output is correct |
22 |
Correct |
475 ms |
278744 KB |
Output is correct |
23 |
Correct |
462 ms |
277028 KB |
Output is correct |
24 |
Correct |
462 ms |
277444 KB |
Output is correct |
25 |
Correct |
454 ms |
277976 KB |
Output is correct |
26 |
Correct |
436 ms |
277792 KB |
Output is correct |
27 |
Correct |
392 ms |
263748 KB |
Output is correct |
28 |
Correct |
396 ms |
268068 KB |
Output is correct |
29 |
Correct |
394 ms |
265064 KB |
Output is correct |
30 |
Correct |
389 ms |
261820 KB |
Output is correct |
31 |
Correct |
391 ms |
262824 KB |
Output is correct |
32 |
Correct |
368 ms |
260164 KB |
Output is correct |
33 |
Correct |
353 ms |
262812 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
103 ms |
206924 KB |
Output is correct |
2 |
Correct |
96 ms |
206924 KB |
Output is correct |
3 |
Correct |
93 ms |
206912 KB |
Output is correct |
4 |
Correct |
129 ms |
207196 KB |
Output is correct |
5 |
Correct |
172 ms |
207124 KB |
Output is correct |
6 |
Correct |
102 ms |
207308 KB |
Output is correct |
7 |
Correct |
97 ms |
207172 KB |
Output is correct |
8 |
Correct |
100 ms |
207204 KB |
Output is correct |
9 |
Correct |
277 ms |
214876 KB |
Output is correct |
10 |
Correct |
649 ms |
392400 KB |
Output is correct |
11 |
Correct |
115 ms |
207172 KB |
Output is correct |
12 |
Correct |
172 ms |
207256 KB |
Output is correct |
13 |
Correct |
611 ms |
397604 KB |
Output is correct |
14 |
Correct |
708 ms |
397744 KB |
Output is correct |
15 |
Correct |
1412 ms |
427732 KB |
Output is correct |
16 |
Correct |
2064 ms |
486844 KB |
Output is correct |
17 |
Correct |
698 ms |
402592 KB |
Output is correct |
18 |
Correct |
857 ms |
404428 KB |
Output is correct |
19 |
Correct |
667 ms |
402008 KB |
Output is correct |
20 |
Correct |
678 ms |
401896 KB |
Output is correct |
21 |
Correct |
974 ms |
429208 KB |
Output is correct |
22 |
Correct |
766 ms |
398964 KB |
Output is correct |
23 |
Correct |
95 ms |
206944 KB |
Output is correct |
24 |
Correct |
110 ms |
206940 KB |
Output is correct |
25 |
Correct |
105 ms |
207172 KB |
Output is correct |
26 |
Correct |
110 ms |
207160 KB |
Output is correct |
27 |
Correct |
109 ms |
207204 KB |
Output is correct |
28 |
Correct |
99 ms |
207212 KB |
Output is correct |
29 |
Correct |
96 ms |
207180 KB |
Output is correct |
30 |
Correct |
102 ms |
207132 KB |
Output is correct |
31 |
Correct |
113 ms |
207188 KB |
Output is correct |
32 |
Correct |
98 ms |
207156 KB |
Output is correct |
33 |
Correct |
96 ms |
207176 KB |
Output is correct |
34 |
Correct |
97 ms |
207052 KB |
Output is correct |
35 |
Correct |
120 ms |
207044 KB |
Output is correct |
36 |
Correct |
100 ms |
207016 KB |
Output is correct |
37 |
Correct |
93 ms |
206976 KB |
Output is correct |
38 |
Correct |
99 ms |
207232 KB |
Output is correct |
39 |
Correct |
98 ms |
207052 KB |
Output is correct |
40 |
Correct |
101 ms |
207180 KB |
Output is correct |
41 |
Correct |
98 ms |
206996 KB |
Output is correct |
42 |
Correct |
108 ms |
207164 KB |
Output is correct |
43 |
Correct |
101 ms |
207160 KB |
Output is correct |
44 |
Correct |
103 ms |
207108 KB |
Output is correct |
45 |
Correct |
95 ms |
206920 KB |
Output is correct |
46 |
Correct |
94 ms |
207080 KB |
Output is correct |
47 |
Correct |
96 ms |
207192 KB |
Output is correct |
48 |
Correct |
101 ms |
207180 KB |
Output is correct |
49 |
Correct |
105 ms |
207064 KB |
Output is correct |
50 |
Correct |
96 ms |
207016 KB |
Output is correct |
51 |
Correct |
101 ms |
207272 KB |
Output is correct |
52 |
Correct |
105 ms |
207172 KB |
Output is correct |
53 |
Correct |
108 ms |
207212 KB |
Output is correct |
54 |
Correct |
100 ms |
207156 KB |
Output is correct |
55 |
Correct |
102 ms |
207288 KB |
Output is correct |
56 |
Correct |
120 ms |
207080 KB |
Output is correct |
57 |
Correct |
117 ms |
207152 KB |
Output is correct |
58 |
Correct |
94 ms |
207100 KB |
Output is correct |
59 |
Correct |
95 ms |
207088 KB |
Output is correct |
60 |
Correct |
287 ms |
214428 KB |
Output is correct |
61 |
Correct |
645 ms |
392396 KB |
Output is correct |
62 |
Correct |
280 ms |
214740 KB |
Output is correct |
63 |
Correct |
184 ms |
210956 KB |
Output is correct |
64 |
Correct |
189 ms |
212364 KB |
Output is correct |
65 |
Correct |
244 ms |
214256 KB |
Output is correct |
66 |
Correct |
117 ms |
207696 KB |
Output is correct |
67 |
Correct |
417 ms |
294480 KB |
Output is correct |
68 |
Correct |
432 ms |
294660 KB |
Output is correct |
69 |
Correct |
643 ms |
378328 KB |
Output is correct |
70 |
Correct |
648 ms |
378332 KB |
Output is correct |
71 |
Correct |
490 ms |
335696 KB |
Output is correct |
72 |
Correct |
483 ms |
335880 KB |
Output is correct |
73 |
Correct |
535 ms |
364496 KB |
Output is correct |
74 |
Correct |
549 ms |
364764 KB |
Output is correct |
75 |
Correct |
124 ms |
212556 KB |
Output is correct |
76 |
Correct |
471 ms |
284484 KB |
Output is correct |
77 |
Correct |
105 ms |
206980 KB |
Output is correct |
78 |
Correct |
120 ms |
206992 KB |
Output is correct |
79 |
Correct |
108 ms |
206960 KB |
Output is correct |
80 |
Correct |
97 ms |
206956 KB |
Output is correct |
81 |
Correct |
108 ms |
207004 KB |
Output is correct |
82 |
Correct |
98 ms |
207056 KB |
Output is correct |
83 |
Correct |
97 ms |
207072 KB |
Output is correct |
84 |
Correct |
103 ms |
207032 KB |
Output is correct |
85 |
Correct |
110 ms |
207016 KB |
Output is correct |
86 |
Correct |
98 ms |
206988 KB |
Output is correct |
87 |
Correct |
94 ms |
206984 KB |
Output is correct |
88 |
Correct |
102 ms |
207156 KB |
Output is correct |
89 |
Correct |
138 ms |
207164 KB |
Output is correct |
90 |
Correct |
159 ms |
207068 KB |
Output is correct |
91 |
Correct |
140 ms |
207048 KB |
Output is correct |
92 |
Correct |
386 ms |
271620 KB |
Output is correct |
93 |
Correct |
585 ms |
282748 KB |
Output is correct |
94 |
Correct |
844 ms |
302532 KB |
Output is correct |
95 |
Correct |
443 ms |
273364 KB |
Output is correct |
96 |
Correct |
412 ms |
272276 KB |
Output is correct |
97 |
Correct |
403 ms |
272620 KB |
Output is correct |
98 |
Correct |
475 ms |
278744 KB |
Output is correct |
99 |
Correct |
462 ms |
277028 KB |
Output is correct |
100 |
Correct |
462 ms |
277444 KB |
Output is correct |
101 |
Correct |
454 ms |
277976 KB |
Output is correct |
102 |
Correct |
436 ms |
277792 KB |
Output is correct |
103 |
Correct |
392 ms |
263748 KB |
Output is correct |
104 |
Correct |
396 ms |
268068 KB |
Output is correct |
105 |
Correct |
394 ms |
265064 KB |
Output is correct |
106 |
Correct |
389 ms |
261820 KB |
Output is correct |
107 |
Correct |
391 ms |
262824 KB |
Output is correct |
108 |
Correct |
368 ms |
260164 KB |
Output is correct |
109 |
Correct |
353 ms |
262812 KB |
Output is correct |
110 |
Correct |
161 ms |
208196 KB |
Output is correct |
111 |
Correct |
143 ms |
207680 KB |
Output is correct |
112 |
Correct |
1396 ms |
425672 KB |
Output is correct |
113 |
Correct |
985 ms |
384152 KB |
Output is correct |
114 |
Correct |
843 ms |
350672 KB |
Output is correct |
115 |
Correct |
205 ms |
244512 KB |
Output is correct |
116 |
Correct |
472 ms |
288416 KB |
Output is correct |
117 |
Correct |
964 ms |
324972 KB |
Output is correct |
118 |
Correct |
436 ms |
283340 KB |
Output is correct |
119 |
Correct |
423 ms |
283412 KB |
Output is correct |
120 |
Correct |
124 ms |
214348 KB |
Output is correct |
121 |
Correct |
680 ms |
302028 KB |
Output is correct |
122 |
Correct |
668 ms |
298304 KB |
Output is correct |
123 |
Correct |
961 ms |
389720 KB |
Output is correct |
124 |
Correct |
986 ms |
389560 KB |
Output is correct |
125 |
Correct |
1053 ms |
390280 KB |
Output is correct |
126 |
Correct |
1958 ms |
477196 KB |
Output is correct |
127 |
Correct |
1166 ms |
424548 KB |
Output is correct |
128 |
Correct |
1049 ms |
425896 KB |
Output is correct |
129 |
Correct |
889 ms |
400588 KB |
Output is correct |
130 |
Correct |
993 ms |
420656 KB |
Output is correct |