QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#649734#6109. Similarity Graphstrlen_s_AC ✓3ms4044kbC++172.2kb2024-10-18 09:32:052024-10-18 09:32:11

Judging History

你现在查看的是最新测评结果

  • [2024-10-18 09:32:11]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:4044kb
  • [2024-10-18 09:32:05]
  • 提交

answer

#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N=105,M=5005;
int mp[N][N];
int id[N][N],cnt;
int cx[M],cy[M];
int f[M<<1],col[M<<1];
vector<int>G[M];
int ansp[N],ansq[N];
int n;
int find(int x){return f[x]==x?x:f[x]=find(f[x]);}
bool iscon(int x,int y){return find(x)==find(y);}
bool merge(int x,int y){
  x=find(x),y=find(y);
  if(x==y)return 0;
  f[x]=y;return 1;
}
signed main(){
  ios::sync_with_stdio(0);
  cin.tie(0),cout.tie(0);
  cin>>n;
  for(int i=1;i<=n;i++)
    for(int j=1;j<=n;j++)
      cin>>mp[i][j];
  for(int i=1;i<=n;i++)
    for(int j=i+1;j<=n;j++)
      id[i][j]=++cnt,cx[cnt]=i,cy[cnt]=j;
  for(int i=1;i<=cnt+cnt;i++)f[i]=i;
  for(int i=1;i<=n;i++)
    for(int j=i+1;j<=n;j++)
      for(int k=j+1;k<=n;k++){
        if((mp[i][j]&&mp[j][k]&&mp[i][k])||(!mp[i][j]&&!mp[j][k]&&!mp[i][k]))continue;
        if((mp[i][j]&&mp[i][k])||(!mp[i][j]&&!mp[i][k])){
          if(iscon(id[i][j],id[i][k]+cnt)){cout<<"NO\n";return 0;}
          merge(id[i][j],id[i][k]),merge(id[i][j]+cnt,id[i][k]+cnt);
        }
        if((mp[i][j]&&mp[j][k])||(!mp[i][j]&&!mp[j][k])){
          if(iscon(id[i][j],id[j][k])){cout<<"NO\n";return 0;}
          merge(id[i][j],id[j][k]+cnt),merge(id[i][j]+cnt,id[j][k]);
        }
        if((mp[i][k]&&mp[j][k])||(!mp[i][k]&&!mp[j][k])){
          if(iscon(id[i][k],id[j][k]+cnt)){cout<<"NO\n";return 0;}
          merge(id[i][k],id[j][k]),merge(id[i][k]+cnt,id[j][k]+cnt);
        }
      }
  for(int i=1;i<=n;i++)ansp[i]=ansq[i]=1;
  for(int i=1;i<=cnt;i++){
    if(!col[find(i)]&&!col[find(i+cnt)])col[find(i)]=1,col[find(i+cnt)]=2;
    if(col[find(i)])col[i]=col[find(i)],col[find(i+cnt)]=3-col[i];
    else if(col[find(i+cnt)])col[i]=3-col[find(i)],col[find(i)]=col[i];
  }
  for(int i=1;i<=cnt;i++){
    if(!mp[cx[i]][cy[i]]){
      if(col[i]==1)ansp[cx[i]]++,ansq[cy[i]]++;
      else ansp[cy[i]]++,ansq[cx[i]]++;
    }
    else{
      if(col[i]==1)ansp[cx[i]]++,ansq[cx[i]]++;
      else ansp[cy[i]]++,ansq[cy[i]]++;
    }
  }
  cout<<"YES\n";
  for(int i=1;i<=n;i++)cout<<ansp[i]<<' ';cout<<'\n';
  for(int i=1;i<=n;i++)cout<<ansq[i]<<' ';cout<<'\n';
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3728kb

input:

4
0 1 0 1
1 0 0 0
0 0 0 1
1 0 1 0

output:

YES
4 3 2 1 
3 1 4 2 

result:

ok ok

Test #2:

score: 0
Accepted
time: 0ms
memory: 3792kb

input:

6
0 1 0 1 0 1
1 0 0 0 1 0
0 0 0 1 1 1
1 0 1 0 0 0
0 1 1 0 0 0
1 0 1 0 0 0

output:

NO

result:

ok ok

Test #3:

score: 0
Accepted
time: 0ms
memory: 3852kb

input:

1
0

output:

YES
1 
1 

result:

ok ok

Test #4:

score: 0
Accepted
time: 0ms
memory: 3732kb

input:

2
0 0
0 0

output:

YES
2 1 
1 2 

result:

ok ok

Test #5:

score: 0
Accepted
time: 0ms
memory: 3768kb

input:

2
0 1
1 0

output:

YES
2 1 
2 1 

result:

ok ok

Test #6:

score: 0
Accepted
time: 0ms
memory: 3816kb

input:

3
0 0 0
0 0 0
0 0 0

output:

YES
3 2 1 
1 2 3 

result:

ok ok

Test #7:

score: 0
Accepted
time: 0ms
memory: 3776kb

input:

3
0 0 0
0 0 1
0 1 0

output:

YES
3 2 1 
1 3 2 

result:

ok ok

Test #8:

score: 0
Accepted
time: 0ms
memory: 3856kb

input:

3
0 0 1
0 0 0
1 0 0

output:

YES
3 1 2 
2 3 1 

result:

ok ok

Test #9:

score: 0
Accepted
time: 0ms
memory: 3808kb

input:

3
0 0 1
0 0 1
1 1 0

output:

YES
3 2 1 
2 3 1 

result:

ok ok

Test #10:

score: 0
Accepted
time: 0ms
memory: 3732kb

input:

3
0 1 0
1 0 0
0 0 0

output:

YES
3 2 1 
2 1 3 

result:

ok ok

Test #11:

score: 0
Accepted
time: 0ms
memory: 3736kb

input:

3
0 1 0
1 0 1
0 1 0

output:

YES
3 1 2 
2 1 3 

result:

ok ok

Test #12:

score: 0
Accepted
time: 0ms
memory: 3740kb

input:

3
0 1 1
1 0 0
1 0 0

output:

YES
3 2 1 
3 1 2 

result:

ok ok

Test #13:

score: 0
Accepted
time: 0ms
memory: 3732kb

input:

3
0 1 1
1 0 1
1 1 0

output:

YES
3 2 1 
3 2 1 

result:

ok ok

Test #14:

score: 0
Accepted
time: 0ms
memory: 3708kb

input:

4
0 0 1 0
0 0 1 0
1 1 0 0
0 0 0 0

output:

YES
4 3 2 1 
2 3 1 4 

result:

ok ok

Test #15:

score: 0
Accepted
time: 0ms
memory: 3816kb

input:

4
0 1 1 1
1 0 0 0
1 0 0 0
1 0 0 0

output:

YES
4 3 2 1 
4 1 2 3 

result:

ok ok

Test #16:

score: 0
Accepted
time: 0ms
memory: 3728kb

input:

4
0 1 0 1
1 0 1 0
0 1 0 0
1 0 0 0

output:

YES
4 1 2 3 
3 2 4 1 

result:

ok ok

Test #17:

score: 0
Accepted
time: 0ms
memory: 3732kb

input:

4
0 1 0 0
1 0 0 0
0 0 0 1
0 0 1 0

output:

YES
4 3 2 1 
2 1 4 3 

result:

ok ok

Test #18:

score: 0
Accepted
time: 0ms
memory: 3776kb

input:

4
0 0 0 0
0 0 0 0
0 0 0 1
0 0 1 0

output:

YES
4 3 2 1 
1 2 4 3 

result:

ok ok

Test #19:

score: 0
Accepted
time: 0ms
memory: 3736kb

input:

5
0 0 1 0 1
0 0 1 1 1
1 1 0 1 1
0 1 1 0 0
1 1 1 0 0

output:

YES
5 4 1 2 3 
3 5 1 4 2 

result:

ok ok

Test #20:

score: 0
Accepted
time: 0ms
memory: 3780kb

input:

5
0 0 1 0 1
0 0 1 0 1
1 1 0 0 0
0 0 0 0 1
1 1 0 1 0

output:

YES
5 4 3 2 1 
3 4 1 5 2 

result:

ok ok

Test #21:

score: 0
Accepted
time: 0ms
memory: 3732kb

input:

5
0 1 0 1 0
1 0 1 0 1
0 1 0 1 1
1 0 1 0 0
0 1 1 0 0

output:

YES
5 1 4 3 2 
3 2 5 1 4 

result:

ok ok

Test #22:

score: 0
Accepted
time: 0ms
memory: 3732kb

input:

5
0 1 0 1 0
1 0 1 1 1
0 1 0 1 0
1 1 1 0 1
0 1 0 1 0

output:

YES
5 2 4 1 3 
3 2 4 1 5 

result:

ok ok

Test #23:

score: 0
Accepted
time: 0ms
memory: 3864kb

input:

5
0 1 0 0 1
1 0 1 1 0
0 1 0 0 0
0 1 0 0 0
1 0 0 0 0

output:

YES
5 1 3 2 4 
3 2 4 5 1 

result:

ok ok

Test #24:

score: 0
Accepted
time: 0ms
memory: 3740kb

input:

6
0 0 1 0 0 1
0 0 0 1 1 1
1 0 0 1 1 0
0 1 1 0 1 1
0 1 1 1 0 1
1 1 0 1 1 0

output:

YES
6 2 3 5 4 1 
3 4 1 6 5 2 

result:

ok ok

Test #25:

score: 0
Accepted
time: 0ms
memory: 3792kb

input:

6
0 0 1 0 1 0
0 0 0 1 1 1
1 0 0 0 1 0
0 1 0 0 0 0
1 1 1 0 0 1
0 1 0 0 1 0

output:

YES
6 4 5 1 2 3 
3 6 2 5 1 4 

result:

ok ok

Test #26:

score: 0
Accepted
time: 0ms
memory: 3820kb

input:

6
0 0 1 0 1 1
0 0 1 1 0 0
1 1 0 1 0 0
0 1 1 0 1 1
1 0 0 1 0 0
1 0 0 1 0 0

output:

YES
6 2 1 5 4 3 
4 5 3 6 1 2 

result:

ok ok

Test #27:

score: 0
Accepted
time: 0ms
memory: 3856kb

input:

6
0 1 0 1 0 0
1 0 0 0 0 0
0 0 0 0 0 1
1 0 0 0 1 1
0 0 0 1 0 0
0 0 1 1 0 0

output:

YES
6 5 1 2 4 3 
3 1 5 2 4 6 

result:

ok ok

Test #28:

score: 0
Accepted
time: 0ms
memory: 3736kb

input:

6
0 0 0 0 0 1
0 0 1 0 1 1
0 1 0 0 1 1
0 0 0 0 1 1
0 1 1 1 0 0
1 1 1 1 0 0

output:

YES
6 5 4 3 1 2 
2 5 4 6 3 1 

result:

ok ok

Test #29:

score: 0
Accepted
time: 0ms
memory: 3800kb

input:

7
0 1 0 1 1 0 1
1 0 1 0 1 1 1
0 1 0 0 0 0 0
1 0 0 0 0 0 0
1 1 0 0 0 0 1
0 1 0 0 0 0 1
1 1 0 0 1 1 0

output:

YES
7 1 2 6 5 4 3 
5 2 7 1 4 6 3 

result:

ok ok

Test #30:

score: 0
Accepted
time: 0ms
memory: 3728kb

input:

7
0 0 1 0 0 1 0
0 0 1 0 1 1 0
1 1 0 0 0 1 1
0 0 0 0 0 1 0
0 1 0 0 0 1 0
1 1 1 1 1 0 1
0 0 1 0 0 1 0

output:

YES
7 5 4 2 3 1 6 
3 6 2 7 5 1 4 

result:

ok ok

Test #31:

score: 0
Accepted
time: 0ms
memory: 3852kb

input:

7
0 0 1 0 0 0 1
0 0 0 1 0 1 0
1 0 0 0 0 0 1
0 1 0 0 0 0 1
0 0 0 0 0 1 1
0 1 0 0 1 0 0
1 0 1 1 1 0 0

output:

NO

result:

ok ok

Test #32:

score: 0
Accepted
time: 0ms
memory: 3868kb

input:

7
0 1 1 0 1 0 1
1 0 0 1 0 1 1
1 0 0 0 0 1 0
0 1 0 0 0 1 0
1 0 0 0 0 1 0
0 1 1 1 1 0 0
1 1 0 0 0 0 0

output:

NO

result:

ok ok

Test #33:

score: 0
Accepted
time: 0ms
memory: 3740kb

input:

7
0 1 0 1 1 1 0
1 0 0 0 0 0 0
0 0 0 1 0 1 0
1 0 1 0 1 1 1
1 0 0 1 0 0 0
1 0 1 1 0 0 1
0 0 0 1 0 1 0

output:

YES
7 6 4 1 5 2 3 
5 1 6 2 3 4 7 

result:

ok ok

Test #34:

score: 0
Accepted
time: 0ms
memory: 3796kb

input:

8
0 0 0 0 0 0 0 0
0 0 1 1 1 0 1 0
0 1 0 1 0 1 1 1
0 1 1 0 1 1 1 0
0 1 0 1 0 1 0 1
0 0 1 1 1 0 1 0
0 1 1 1 0 1 0 1
0 0 1 0 1 0 1 0

output:

YES
8 7 3 5 1 6 2 4 
1 6 3 5 4 7 2 8 

result:

ok ok

Test #35:

score: 0
Accepted
time: 0ms
memory: 3740kb

input:

12
0 1 0 1 0 0 1 1 0 1 0 0
1 0 0 0 1 0 1 1 1 0 1 1
0 0 0 0 1 1 1 1 0 1 0 0
1 0 0 0 1 0 1 1 1 0 0 0
0 1 1 1 0 1 0 0 0 1 0 0
0 0 1 0 1 0 1 1 0 1 0 0
1 1 1 1 0 1 0 0 0 1 0 0
1 1 1 1 0 1 0 0 0 1 1 0
0 1 0 1 0 0 0 0 0 0 1 1
1 0 1 0 1 1 1 1 0 0 0 0
0 1 0 0 0 0 0 1 1 0 0 0
0 1 0 0 0 0 0 0 1 0 0 0

output:

YES
7 5 3 4 6 2 8 10 12 1 9 11 
7 1 9 4 12 8 11 10 5 6 3 2 

result:

ok ok

Test #36:

score: 0
Accepted
time: 0ms
memory: 3800kb

input:

13
0 0 1 0 1 1 0 0 0 1 1 1 0
0 0 1 1 1 0 0 0 0 1 1 1 0
1 1 0 0 0 1 1 1 1 1 0 1 1
0 1 0 0 0 0 1 0 1 1 1 0 0
1 1 0 0 0 1 1 1 1 1 0 1 1
1 0 1 0 1 0 0 0 0 1 1 1 1
0 0 1 1 1 0 0 0 0 1 1 0 0
0 0 1 0 1 0 0 0 0 1 1 1 0
0 0 1 1 1 0 0 0 0 1 1 0 0
1 1 1 1 1 1 1 1 1 0 1 1 1
1 1 0 1 0 1 1 1 1 1 0 0 1
1 1 1 0 1 1...

output:

YES
13 9 5 3 4 11 7 10 6 1 2 8 12 
7 11 2 10 3 6 12 9 13 1 5 4 8 

result:

ok ok

Test #37:

score: 0
Accepted
time: 0ms
memory: 3804kb

input:

17
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 0 1 1 0 1 0 1 1 1 0 1 0 1 1 1 1
1 1 0 1 0 0 0 1 0 1 0 1 0 1 1 0 1
1 1 1 0 1 0 0 0 0 1 0 0 1 0 1 0 0
1 0 0 1 0 0 0 1 0 1 0 0 1 1 0 0 1
1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 0 1 0 0 0 0 1 1 0 1 1 1 0 1
1 1 0 0 0 0 0 0 0 0 0 0 0...

output:

YES
17 16 11 7 8 15 1 5 12 3 6 9 10 4 13 14 2 
17 12 10 6 13 2 16 9 3 5 15 4 14 8 11 1 7 

result:

ok ok

Test #38:

score: 0
Accepted
time: 0ms
memory: 3800kb

input:

24
0 1 1 0 1 1 1 1 1 0 0 1 1 1 0 1 1 1 0 1 1 1 1 1
1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 1 0 1 0 0 0 1 0 1
1 0 0 0 0 0 0 0 1 0 0 0 0 1 1 1 0 1 0 0 0 0 0 1
0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 0 0 0 0 0 1 0
1 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 1 0 0 1 0 1 0
1 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 1 1 0 1 0 0
1 0 0 1 1...

output:

YES
22 13 11 6 7 16 4 15 3 5 23 14 12 10 20 1 21 19 24 18 9 17 2 8 
21 12 15 22 18 3 17 2 6 23 5 4 8 14 24 1 9 20 10 11 19 13 16 7 

result:

ok ok

Test #39:

score: 0
Accepted
time: 0ms
memory: 3752kb

input:

27
0 1 1 1 0 1 1 0 0 0 1 0 1 1 0 1 0 0 1 1 1 1 1 1 1 1 0
1 0 1 0 1 1 0 1 0 1 1 1 1 1 0 1 0 1 0 1 1 1 1 0 1 1 1
1 1 0 1 1 1 0 0 0 1 1 1 1 0 0 1 0 1 0 1 0 0 1 1 0 1 1
1 0 1 0 1 1 0 1 0 1 1 1 1 1 0 1 0 1 0 1 1 1 1 1 1 1 1
0 1 1 1 0 0 1 0 0 0 0 1 1 1 0 1 0 0 1 1 1 1 0 1 1 0 1
1 1 1 1 0 0 1 0 1 0 0 1 1 1...

output:

YES
18 3 4 1 16 22 11 23 19 17 21 10 8 9 25 13 27 20 7 12 6 15 26 2 14 24 5 
19 6 14 7 27 21 5 11 3 23 24 20 16 9 1 15 2 18 4 17 13 10 26 12 8 25 22 

result:

ok ok

Test #40:

score: 0
Accepted
time: 0ms
memory: 3844kb

input:

31
0 1 1 1 0 1 0 1 1 1 1 0 1 1 0 1 0 0 1 0 0 0 1 0 1 1 1 0 0 0 1
1 0 1 0 1 1 0 0 0 1 0 1 0 1 1 1 0 1 1 0 0 0 1 0 0 1 0 0 0 0 0
1 1 0 1 0 1 0 1 1 1 1 0 1 1 0 1 0 0 1 0 0 0 1 0 1 1 1 0 0 0 1
1 0 1 0 1 1 1 1 1 0 1 1 0 0 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1
0 1 0 1 0 0 1 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1...

output:

YES
30 19 29 1 26 27 6 8 18 11 7 21 28 4 24 20 15 23 25 13 16 17 22 10 3 31 14 9 12 5 2 
17 4 16 8 29 9 21 15 14 2 10 20 3 1 18 12 31 24 7 23 25 19 5 28 13 22 6 30 26 27 11 

result:

ok ok

Test #41:

score: 0
Accepted
time: 0ms
memory: 3888kb

input:

39
0 1 0 0 0 1 0 1 0 0 1 0 1 1 0 0 0 1 0 1 0 0 0 1 1 1 0 0 1 0 0 0 1 0 0 1 1 1 1
1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 1 1 0 1 0
0 0 0 0 1 0 1 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 1 1 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0
0 1 0 0 1 1 0 1 0 0 1 0 1 1 0 0 0 1 0 1 0 0 0 1 1 1 0 0 1 0 0 0...

output:

YES
37 31 1 35 36 24 7 12 28 8 22 4 23 14 5 38 25 6 13 9 34 27 26 39 17 16 21 15 30 10 29 20 33 2 32 11 18 3 19 
18 7 28 19 37 6 29 15 24 32 14 31 10 17 22 11 39 1 21 8 27 23 30 36 12 3 33 34 16 35 38 25 5 26 20 4 9 2 13 

result:

ok ok

Test #42:

score: 0
Accepted
time: 0ms
memory: 3796kb

input:

48
0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 1 1 1 1 1 0 1 1 0 0 0 1 0 1 1 0 0 1 1 0 1 1 0 0 1 1 0 1
1 0 0 0 0 1 0 0 0 0 1 0 1 1 1 1 1 1 1 0 1 1 1 1 0 0 1 0 1 0 0 1 0 1 0 1 1 1 1 0 0 1 0 0 1 1 0 1
0 0 0 0 1 0 0 1 0 0 1 1 0 0 0 0 1 0 0 1 1 0 0 1 0 1 1 0 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 0 0 1 0
0 0 0 0 0...

output:

YES
41 29 7 25 11 39 4 20 21 8 30 3 33 32 38 42 37 10 16 12 6 35 18 1 28 5 43 9 40 27 19 23 17 48 2 31 36 46 44 24 15 34 26 22 45 13 14 47 
15 8 38 21 39 20 41 46 23 18 47 17 34 22 31 28 45 6 2 44 7 14 5 1 11 19 42 10 37 35 29 4 40 27 12 36 33 43 26 24 9 13 32 25 30 3 48 16 

result:

ok ok

Test #43:

score: 0
Accepted
time: 1ms
memory: 3936kb

input:

53
0 1 1 0 1 1 0 0 0 1 1 0 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0
1 0 1 0 0 0 1 1 1 1 0 1 0 0 0 0 0 0 0 0 1 0 0 1 1 1 0 0 1 1 1 0 1 1 0 0 0 1 1 0 1 0 0 1 0 1 0 0 1 0 1 1 1
1 1 0 0 1 0 1 1 1 1 0 1 0 0 0 1 1 1 0 0 1 0 0 1 1 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1...

output:

YES
45 31 39 9 22 5 47 52 53 30 27 46 28 23 3 19 16 8 17 18 24 21 25 43 29 48 15 2 38 41 34 6 49 36 14 7 50 40 32 11 33 26 37 42 1 20 12 13 44 10 35 4 51 
45 8 16 53 15 17 40 25 36 3 43 34 26 24 29 9 11 10 44 32 2 46 50 51 7 52 20 30 33 13 49 47 14 12 27 22 4 37 19 23 48 38 6 31 28 5 41 35 21 42 18 ...

result:

ok ok

Test #44:

score: 0
Accepted
time: 1ms
memory: 3896kb

input:

59
0 1 1 1 0 0 1 1 1 0 0 0 1 1 0 1 1 1 0 1 0 0 0 0 0 1 1 0 1 1 0 1 0 0 0 1 0 1 0 1 1 1 0 1 1 1 1 0 0 0 0 0 0 1 0 1 1 1 0
1 0 1 0 0 0 0 1 1 1 0 0 1 1 0 1 1 1 0 1 0 0 0 0 1 1 1 0 1 1 0 1 1 0 0 1 0 1 0 1 1 1 0 1 1 1 1 0 1 0 0 0 0 1 0 1 1 1 0
1 1 0 1 1 0 1 1 0 1 1 0 0 1 0 0 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1...

output:

YES
39 33 51 34 1 24 11 10 54 38 41 29 43 26 19 57 53 25 6 40 30 14 56 49 36 22 50 3 27 8 47 55 35 13 18 23 2 9 28 52 45 44 7 21 42 4 31 46 37 16 5 12 17 59 15 20 58 32 48 
23 21 43 17 28 44 22 2 41 26 3 48 59 4 52 24 57 14 54 50 51 56 5 11 27 19 29 34 7 15 20 39 55 25 36 10 33 9 49 53 58 32 47 1 42...

result:

ok ok

Test #45:

score: 0
Accepted
time: 1ms
memory: 3880kb

input:

65
0 0 1 0 1 1 0 0 0 0 0 0 1 1 0 1 0 0 1 0 1 0 0 1 0 1 0 0 1 1 0 0 1 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 1 1 0 1 1 0 0 0
0 0 0 0 0 1 1 0 1 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 1 1 0 0 0 1 0 0 1 0 0 1 0 1 1 0 1 0 0 0 1 0 1 1 1 1 1 1 1 0 1 0 0 0 0 0 1 1 0
1 0 0 0 0 1 0 1 0 0 0 1 1 1 1 0 0 0 0...

output:

YES
57 4 37 3 44 58 25 38 35 30 28 50 39 26 55 22 16 19 43 42 51 10 17 14 11 60 7 6 9 41 20 36 59 65 8 18 49 40 1 56 21 12 45 53 48 63 54 32 52 23 27 29 34 2 33 13 5 62 47 64 24 61 31 46 15 
20 33 10 39 3 51 40 25 61 55 29 46 16 1 34 12 65 47 7 38 2 31 58 15 62 37 53 54 18 17 24 43 28 13 35 26 6 60 ...

result:

ok ok

Test #46:

score: 0
Accepted
time: 2ms
memory: 3852kb

input:

72
0 1 0 1 0 0 0 1 0 0 0 0 1 1 1 1 1 0 1 0 0 1 1 0 0 0 1 0 1 1 1 0 1 0 0 0 1 1 1 0 0 0 0 0 1 0 1 1 0 1 0 1 1 1 1 1 1 1 0 0 1 1 0 0 1 1 1 1 1 1 0 1
1 0 0 1 1 0 1 1 0 0 1 1 1 1 0 1 1 1 0 0 0 1 1 0 0 1 1 1 1 1 1 1 1 0 0 0 1 1 1 0 1 1 1 0 0 1 0 0 0 1 0 0 1 1 1 0 1 1 1 0 1 1 0 0 1 0 0 1 1 1 1 0
0 0 0 0 0...

output:

YES
25 23 19 61 38 44 27 47 13 69 68 35 60 32 7 40 26 57 16 2 10 34 36 5 18 59 67 65 54 29 49 53 43 46 56 48 51 28 66 52 45 64 70 15 9 31 21 17 6 71 14 22 50 55 39 11 42 72 58 3 63 4 62 1 30 12 8 24 37 41 33 20 
35 9 59 54 11 3 25 65 43 6 12 14 37 72 24 70 67 26 27 58 39 36 49 46 64 22 61 33 44 50 3...

result:

ok ok

Test #47:

score: 0
Accepted
time: 2ms
memory: 3852kb

input:

77
0 0 0 0 1 0 0 1 1 1 1 0 1 1 0 0 1 1 0 1 0 0 0 0 1 1 0 0 0 0 1 0 1 1 0 1 1 0 0 0 0 0 0 1 1 0 1 0 0 1 1 0 0 0 1 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 0 1 0 0 0
0 0 0 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1 1 0 1 1 1 0 0 0 1 1 0 0 0 1 0 0 0 1 0 1 0 1 0 0 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 0 0 1 0 0 1 1 1 1 1...

output:

YES
58 8 77 52 14 22 26 51 73 47 7 60 65 75 3 9 35 74 10 42 48 40 53 2 38 21 46 12 70 64 44 29 30 16 1 72 54 19 6 27 4 68 32 63 34 31 61 15 36 59 69 45 49 20 33 25 37 11 23 62 71 43 17 5 56 39 24 76 50 57 67 18 66 28 13 55 41 
26 27 9 45 16 30 61 10 73 5 21 7 44 39 34 49 4 54 72 24 29 55 47 33 22 23...

result:

ok ok

Test #48:

score: 0
Accepted
time: 2ms
memory: 4012kb

input:

82
0 0 1 0 0 0 1 0 1 1 0 1 1 0 0 0 0 1 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 1 0 0 0 0 0 0 1 1 1 0 1 0 0 0 0 1 0 1 1 0 0 1 1 0 1 0 0 1 1 1 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0
0 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 1 1 0 0 1 0 0 1 0 0 1 0 1 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 0 1 0 1...

output:

YES
55 17 39 33 16 38 40 7 58 56 28 35 26 50 4 36 65 74 10 2 45 57 77 69 46 66 5 81 32 72 61 42 68 25 15 23 44 34 53 29 18 71 82 14 62 8 19 1 11 79 41 63 76 30 27 78 24 67 52 9 37 80 70 73 21 12 13 47 6 54 64 49 59 31 60 75 22 20 3 51 48 43 
15 57 1 64 81 17 10 53 36 44 22 5 12 77 24 30 9 69 48 59 1...

result:

ok ok

Test #49:

score: 0
Accepted
time: 2ms
memory: 4000kb

input:

86
0 1 1 0 1 0 1 1 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 1 1 0 1 0 0 1 1 1 0 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0 1 1 1 0 0 1 0 1 0 1 1 0 0 1 0 0 0 1 0 1
1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 0 1 1 0 0 1 1 0 1 0 0 1 0 0 0 1 1 0 1 1 0 0 1 0 1 0 0 0 0 0 0 1 0 0 1 1 0 1 1 0 0 1 0 0 0 0...

output:

YES
75 54 26 37 85 79 52 70 84 65 74 2 64 69 71 27 10 13 81 67 8 9 59 68 57 61 48 23 63 16 77 86 58 76 82 72 15 31 22 47 1 17 60 80 28 18 33 73 19 41 45 78 55 5 11 53 83 21 29 49 25 35 44 24 34 56 32 3 66 39 51 62 40 46 36 43 14 20 30 42 6 7 4 38 12 50 
42 28 12 46 82 9 37 21 33 61 10 48 60 22 80 70...

result:

ok ok

Test #50:

score: 0
Accepted
time: 2ms
memory: 3892kb

input:

90
0 0 0 1 0 1 1 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 1 0 0 0 0 1 0 1 0 1 0 1 0 1 0 0 1 0 0 1 0 0 1 0 1 1 1 0 0 1 0 1 1 0 1 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 0 0 1 0 1 0
0 0 1 0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0 0 1 0 1 0 0 0 0 1 0 1 0 0 1 0 1 0 0 0 1 0 0 0 0 0 0 1 1...

output:

YES
72 31 4 57 56 89 82 84 40 7 79 11 41 34 16 70 90 65 2 55 76 68 46 44 19 60 63 1 86 52 78 85 20 48 18 32 33 69 37 15 80 27 81 66 17 49 23 59 38 77 25 64 42 87 35 75 43 6 13 29 9 74 71 26 5 58 67 61 10 53 39 62 88 12 47 21 3 73 45 54 22 36 30 28 24 14 50 8 83 51 
23 87 61 12 90 73 62 1 75 67 83 51...

result:

ok ok

Test #51:

score: 0
Accepted
time: 2ms
memory: 3904kb

input:

91
0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1
1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 0 1 1 1 1 0 0 0 0 1 0 1 1 0 1 0 0 1 0 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 1 1 1 1 1 1 0...

output:

YES
90 68 40 22 59 58 88 61 67 77 63 64 49 4 79 78 15 10 29 47 31 86 23 87 50 80 28 48 84 33 12 74 38 75 41 26 53 19 82 14 13 89 17 81 91 54 32 39 85 44 2 46 43 7 37 3 8 51 56 21 45 52 72 18 30 9 24 76 35 5 62 34 73 27 1 57 16 83 20 36 55 11 69 71 25 60 42 6 66 65 70 
88 74 49 67 50 16 55 41 40 57 8...

result:

ok ok

Test #52:

score: 0
Accepted
time: 2ms
memory: 4036kb

input:

92
0 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1
1 0 1 1 1 0 1 0 0 0 0 0 1 1 1 0 0 1 0 1 1 0 1 1 1 0 1 1 0 1 0 0 0 0 0 0 1 0 1 0 1 1 1 1 1 1 0 1 0 1 0 0 0 0 0 1 1...

output:

YES
88 51 9 53 14 29 24 3 1 34 67 12 46 4 82 37 47 6 33 76 18 73 23 71 92 68 7 56 26 72 66 5 77 17 79 87 70 45 30 85 43 41 21 10 19 64 55 32 84 36 28 78 91 75 40 27 25 8 50 52 59 69 13 90 38 89 63 48 62 61 81 16 49 20 35 74 31 2 44 83 15 39 11 60 58 57 80 65 22 86 54 42 
84 51 44 53 5 76 37 72 70 62...

result:

ok ok

Test #53:

score: 0
Accepted
time: 3ms
memory: 3884kb

input:

93
0 0 1 1 0 1 1 1 0 1 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 1 0 0 1 1 0 0 1 1 0 1 1 1 0 0 1 1 1 1 1 1
0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 1 0...

output:

YES
79 10 65 27 61 54 59 60 93 78 81 24 72 47 18 41 64 88 66 86 20 75 45 51 44 15 21 84 67 70 85 29 5 62 34 80 19 33 2 40 35 22 32 52 53 3 31 76 87 57 48 16 28 8 4 30 77 17 74 73 91 13 25 6 46 7 37 50 58 9 55 39 71 82 90 42 56 83 43 49 63 92 14 1 26 11 68 23 89 36 12 38 69 
81 85 33 22 92 71 6 26 41...

result:

ok ok

Test #54:

score: 0
Accepted
time: 3ms
memory: 3904kb

input:

94
0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1
1 0 1 1 0 0 1 0 1 1 1 0 1 1 1 0 0 1 1 1 1 1 1 0 0 0 0 0 0 1 0 0 0 1 1 0 1 1 1 0 0 0 0 0 1 0 1 1 1 1 1 1 1 0 1...

output:

YES
94 54 78 87 26 7 70 34 69 46 62 12 89 74 83 17 29 67 61 90 91 60 36 5 6 44 22 18 15 92 40 33 25 84 71 65 86 76 57 13 9 63 21 28 80 45 8 16 53 35 81 55 68 19 75 56 88 73 1 79 48 58 30 93 51 2 47 66 38 11 82 3 32 14 49 50 37 59 52 27 64 10 77 39 41 20 23 31 4 85 72 24 43 42 
84 15 18 92 27 30 63 5...

result:

ok ok

Test #55:

score: 0
Accepted
time: 3ms
memory: 3968kb

input:

95
0 1 0 1 0 0 1 0 0 0 0 1 0 1 0 1 1 0 1 1 0 0 1 0 0 0 0 0 1 1 1 1 1 0 0 1 0 0 1 0 1 1 1 0 0 1 0 0 0 1 0 1 1 0 0 0 0 1 0 0 1 1 1 1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0
1 0 0 0 1 0 0 1 0 0 0 1 1 1 1 1 0 1 1 0 1 0 0 0 1 0 0 0 0 1 0 1 1 0 1 1 1 1 0 0 0 1 0 1 1 1 0 0 0 1 1 0 1 0...

output:

YES
75 35 18 70 79 31 65 37 33 21 3 38 64 11 83 77 45 60 58 42 43 32 40 95 39 26 10 14 56 80 72 29 49 22 89 34 51 68 55 17 27 53 20 52 57 7 23 78 90 25 50 48 4 8 54 46 69 6 15 59 82 44 47 62 2 71 66 91 84 41 76 87 36 24 88 67 93 5 86 73 13 9 1 19 16 12 28 74 63 92 61 81 94 30 85 
45 25 92 24 31 51 1...

result:

ok ok

Test #56:

score: 0
Accepted
time: 3ms
memory: 3936kb

input:

96
0 0 0 0 0 0 0 0 0 1 0 1 1 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 1 1
0 0 0 1 0 1 1 0 0 0 0 1 0 1 0 0 1 1 0 0 1 0 0 0 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 1 0 0 0 1 0 1 1 0 1 0 0...

output:

YES
81 41 37 79 15 45 73 31 22 48 84 88 94 2 50 62 5 91 28 51 76 61 60 47 63 11 38 8 52 57 67 26 93 46 95 7 14 56 78 35 87 12 64 49 29 53 85 24 36 20 65 34 71 9 77 17 43 18 72 83 59 3 40 4 75 13 30 1 66 96 86 6 10 82 68 80 16 39 44 42 23 90 74 27 70 33 54 19 58 25 32 21 55 89 69 92 
13 46 82 52 85 6...

result:

ok ok

Test #57:

score: 0
Accepted
time: 3ms
memory: 3912kb

input:

97
0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 0
0 0 0 1 0 0 1 1 1 0 1 0 0 0 0 1 0 1 0 1 1 1 1 1 1 1 0 1 0 1 1 1 0 1 0 1 0 0 1 0 0 0 0 1 1 0 1 1 0 0 0 0...

output:

YES
83 63 45 37 51 68 6 10 38 93 62 53 84 56 67 2 49 24 35 55 76 12 32 52 30 1 29 4 21 46 47 20 5 9 81 78 88 65 86 59 87 94 42 31 19 71 57 80 60 43 66 79 48 17 91 8 11 73 28 25 22 3 33 95 82 64 41 7 69 96 13 16 92 50 77 72 70 85 75 58 34 15 44 36 26 40 27 89 61 39 14 97 23 74 54 90 18 
10 63 78 7 90...

result:

ok ok

Test #58:

score: 0
Accepted
time: 0ms
memory: 4032kb

input:

98
0 0 1 1 0 0 0 1 1 1 1 0 1 1 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 1 1 0 0 1 0 1 1 0 1 0 0 1 1 0 1 1 0 1 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 0 0
0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 1 0 0 1 0 1 1 0...

output:

YES
43 25 29 5 36 71 15 50 63 65 41 91 93 35 90 33 81 75 88 27 69 72 47 20 13 98 89 37 61 48 68 78 66 7 9 38 11 80 53 87 82 95 58 60 84 79 52 45 21 24 76 28 10 67 22 4 73 3 12 23 64 44 40 31 62 8 49 51 39 74 2 46 85 19 86 26 57 32 55 1 56 83 59 16 30 6 54 96 42 70 17 18 14 97 94 77 92 34 
47 85 40 4...

result:

ok ok

Test #59:

score: 0
Accepted
time: 3ms
memory: 3976kb

input:

99
0 1 1 0 0 1 1 1 1 0 1 0 1 0 0 0 0 0 0 0 0 1 1 0 1 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 1 1 1 1 1 0 0 0 0 1 0 0 1 0 1 1 0 0 0 1 0 1 0 1 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 1 1 1 1
1 0 1 0 1 1 0 0 1 0 0 0 0 1 1 0 1 1 1 1 0 1 1 1 0 1 0 1 1 1 1 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 0 1 1...

output:

YES
39 20 46 13 81 26 37 19 30 73 16 15 6 35 83 2 85 59 65 29 97 47 21 76 9 84 38 54 44 33 69 14 96 99 42 94 48 95 87 10 64 89 63 32 88 92 60 53 57 40 68 1 77 22 36 80 34 67 23 11 90 17 66 74 51 70 91 49 12 58 79 78 75 27 4 50 52 7 86 43 93 98 25 31 5 82 56 62 61 55 28 45 72 41 24 8 18 3 71 
71 14 7...

result:

ok ok

Test #60:

score: 0
Accepted
time: 1ms
memory: 3944kb

input:

100
0 0 1 0 0 1 0 0 1 0 0 0 1 1 0 0 1 1 0 0 1 1 1 1 0 1 0 0 0 1 0 0 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 1 1 0 0 0 0 1 0 0 0 1 0 1 0 1 1 1 1 0 0 1 1 0 0 1 0 1 1 0 0 1 1 1 1 1 0 0 0
0 0 0 1 1 1 1 1 0 1 0 0 1 0 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 1 ...

output:

NO

result:

ok ok

Test #61:

score: 0
Accepted
time: 1ms
memory: 4000kb

input:

100
0 0 1 1 0 1 1 0 0 0 1 0 1 0 1 1 0 1 0 1 0 0 0 1 1 0 0 1 1 1 0 0 1 1 1 1 1 1 1 0 1 1 0 1 0 0 1 0 1 0 1 0 0 0 0 1 0 0 1 1 0 0 0 1 1 0 1 0 0 0 1 0 0 1 0 0 0 0 0 1 0 0 0 1 1 0 1 1 0 0 0 1 0 0 0 0 1 0 0 0
0 0 1 0 1 1 0 0 1 0 0 1 1 1 1 1 1 0 1 1 0 1 0 1 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 ...

output:

NO

result:

ok ok

Test #62:

score: 0
Accepted
time: 0ms
memory: 3960kb

input:

100
0 0 0 1 1 0 1 0 0 0 1 0 1 1 0 0 0 1 0 0 0 0 1 0 0 0 1 0 1 1 0 1 0 0 0 1 1 0 0 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 0 1 1 1 0 1 1 1 1 1 0 1 0 0 0 0 0 1 0 1 0 1 0 1 1 1 1 0 0 1 0 0 1 1 0 1 0 1 0 1 1 0 1 1 0 1
0 0 0 1 0 1 0 1 1 0 1 0 1 0 1 0 1 0 0 1 1 1 0 1 0 0 1 1 0 1 1 0 1 1 0 1 0 1 0 1 1 0 0 1 1 0 1 1 ...

output:

NO

result:

ok ok

Test #63:

score: 0
Accepted
time: 1ms
memory: 4008kb

input:

100
0 1 0 1 1 1 0 0 1 1 0 1 0 1 1 1 0 1 0 0 1 0 1 1 1 0 0 1 1 0 0 1 1 0 1 1 0 1 0 0 0 0 0 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 1 0 1 0 1 1 0 0 1 0 1 0 1 1 1 1 1 1 0 0 0 1 0 0 0 1 1 0 1 0 0 0 0 0 1 0 0 0 1 0 0 1
1 0 1 0 0 1 1 0 0 1 1 1 1 0 1 1 0 1 1 1 1 0 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 0 1 0 1 1 1 0 0 0 0 0 ...

output:

NO

result:

ok ok

Test #64:

score: 0
Accepted
time: 0ms
memory: 3916kb

input:

100
0 0 1 1 1 0 1 1 0 0 1 1 1 0 1 0 1 0 0 0 0 1 1 1 1 0 0 1 0 1 1 1 0 0 0 0 0 1 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 0 0 0 1 1 1 1 1 1 1 0 1 1 0 0 0 0 1 0 0 0 0 0 1 1 0 0 1 1 0 0 0 1 1 0
0 0 1 0 1 1 1 1 1 1 0 1 1 0 0 0 1 0 1 1 1 1 1 0 1 0 1 1 0 1 1 1 0 0 0 0 1 1 1 1 1 1 1 0 1 1 1 0 ...

output:

YES
100 91 87 93 17 98 4 31 58 33 99 84 9 77 95 61 49 85 30 18 44 34 63 94 71 74 53 50 51 3 57 5 21 59 41 14 26 20 10 24 1 37 73 29 75 40 65 67 68 54 19 22 64 13 35 86 16 88 97 11 28 80 76 15 55 6 78 89 90 7 8 72 60 23 36 82 38 43 66 81 32 39 83 92 52 46 27 56 47 12 70 48 2 69 25 45 62 79 42 96 
57 ...

result:

ok ok

Test #65:

score: 0
Accepted
time: 3ms
memory: 3900kb

input:

100
0 0 0 1 0 1 1 0 1 0 0 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0 1 1 0 1 1 1 1 1 1 0 1 0 0 1 0 0 1 0 0 1 0 1 0 0 0 1 0 1 1 1 0 0 0 0 1 1 0 1 1 1 0 1 0 0 1 0 1 0 1 0 1 1 1 1 0 1 1 0 0 1 0 0 1 1 1 1 0 0 1 1
0 0 1 0 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1 0 0 1 1 0 1 0 0 1 0 0 1 0 1 0 0 ...

output:

YES
80 27 50 32 39 17 69 52 65 38 82 1 40 70 59 9 63 67 29 55 45 3 18 48 56 28 49 99 89 13 19 7 46 64 23 21 58 24 79 100 22 72 77 25 96 16 37 78 71 5 85 30 84 95 4 10 14 51 60 54 98 20 86 36 75 15 93 92 43 73 83 34 42 26 2 94 88 12 35 91 31 8 6 74 61 62 81 41 97 53 66 33 68 76 11 44 57 90 47 87 
69 ...

result:

ok ok

Test #66:

score: 0
Accepted
time: 3ms
memory: 3976kb

input:

100
0 0 1 0 0 1 1 0 0 0 1 0 0 0 0 1 0 0 1 1 0 1 1 1 1 1 0 1 1 0 1 1 0 1 0 0 1 1 0 0 1 1 1 1 0 1 1 1 0 0 1 0 1 1 0 0 0 0 1 0 1 0 0 0 1 1 0 1 1 0 0 1 1 1 1 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0
0 0 0 1 0 0 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 0 0 0 0 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 0 0 1 0 0 1 1 ...

output:

YES
93 23 51 79 95 88 97 89 52 36 21 82 30 46 41 60 40 92 94 31 62 29 55 25 66 83 65 28 68 50 100 37 59 85 48 44 77 76 80 61 3 63 24 12 16 70 8 2 35 47 19 45 64 5 71 99 43 1 32 86 20 57 15 74 38 67 98 96 42 9 18 56 91 78 10 69 58 34 13 17 14 27 26 54 53 87 75 33 73 72 11 6 49 7 81 22 84 90 4 39 
44 ...

result:

ok ok

Test #67:

score: 0
Accepted
time: 3ms
memory: 4028kb

input:

100
0 1 0 1 1 1 0 1 0 0 1 0 1 1 1 1 1 1 1 0 1 0 1 0 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 0 0 1 0 0 0 1 1 0 1 0 1 1 1 1 1 1 0 1 1 1 1 0 1 0 1 1 1 0 1 1 1 1 0 1 0 1 0 1 1 1 1 0 1 1 1 1 1 0 1 0 1 1 1 0 0 0 0
1 0 0 0 1 1 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 0 0 1 0 0 1 0 0 1 1 0 1 1 1 0 0 0 0 1 1 0 1 0 0 0 1 0 ...

output:

YES
92 23 15 24 16 10 20 36 18 52 31 54 69 41 71 86 68 46 73 22 14 6 83 82 58 37 81 78 85 5 63 76 45 7 11 87 53 65 35 95 89 50 47 97 29 94 28 99 21 42 91 96 70 30 19 77 2 33 39 49 8 67 66 59 88 74 60 4 75 57 17 12 84 48 80 13 38 90 55 93 25 26 32 3 27 62 40 72 79 43 100 1 61 34 64 56 98 51 9 44 
72 ...

result:

ok ok

Test #68:

score: 0
Accepted
time: 0ms
memory: 3912kb

input:

100
0 1 0 0 1 1 0 0 0 0 0 0 1 1 1 0 1 0 1 1 1 0 1 0 1 0 0 0 1 0 1 1 0 1 1 0 1 1 1 1 1 0 0 0 1 1 0 1 0 1 0 1 1 1 0 0 0 1 0 0 0 1 1 1 1 0 0 1 0 0 0 1 1 1 0 0 1 1 1 0 1 1 0 1 0 1 0 1 0 0 1 1 0 0 1 0 1 1 1 1
1 0 1 1 1 1 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 0 0 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 ...

output:

YES
56 16 55 51 60 98 36 35 96 19 85 23 18 70 65 34 9 74 4 99 11 90 53 10 93 76 46 73 28 38 31 61 41 77 94 83 5 81 69 21 44 95 15 89 88 63 78 33 54 71 62 52 91 27 82 30 3 87 67 25 79 59 92 64 86 39 47 24 100 40 20 2 26 72 8 48 12 17 50 43 58 32 22 75 13 14 45 37 80 6 1 66 49 29 42 84 7 97 57 68 
44 ...

result:

ok ok

Test #69:

score: 0
Accepted
time: 3ms
memory: 4044kb

input:

100
0 1 0 1 1 0 0 1 1 0 1 0 1 1 0 1 0 1 1 1 0 0 1 0 0 0 1 0 1 1 0 0 0 0 1 0 1 0 0 1 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 0 1 1 1 1 1 0 0 0 1 0 0 1 0 0 1 1 1 0 0 1 0 0 1 1 0 0 0 0 0 0 1 1 1 1 1 1 0 1 0 0 1 1
1 0 0 0 0 0 0 0 1 0 1 1 0 1 0 1 0 1 0 0 0 0 1 1 0 1 1 1 1 1 1 0 0 0 1 1 0 1 0 1 0 0 0 0 1 0 0 1 ...

output:

YES
82 63 2 25 39 37 11 51 88 28 93 99 52 95 38 91 55 62 78 13 56 7 59 72 58 75 5 64 98 50 90 44 24 19 76 70 8 69 18 96 36 16 57 34 79 92 21 46 85 22 89 3 30 4 80 33 40 23 15 41 94 6 12 43 29 9 74 31 54 10 73 87 83 42 61 32 48 27 14 35 45 49 81 47 66 67 77 1 84 65 26 97 53 60 20 100 17 71 68 86 
39 ...

result:

ok ok

Test #70:

score: 0
Accepted
time: 3ms
memory: 3988kb

input:

100
0 1 0 0 1 0 1 0 1 1 1 0 0 1 0 1 1 0 0 1 0 0 0 1 0 0 1 0 1 1 1 1 1 0 1 1 1 1 0 1 0 1 0 0 0 0 1 0 0 0 1 1 1 0 1 1 1 1 1 1 1 1 0 0 1 1 1 0 0 0 0 0 1 1 1 0 0 1 1 1 0 1 1 0 0 1 0 0 1 1 1 1 0 0 0 1 0 0 1 0
1 0 1 1 1 1 0 0 0 1 1 1 0 1 1 0 1 1 0 0 1 1 0 1 0 1 0 0 1 1 1 0 1 0 0 0 1 0 1 1 0 1 0 0 1 1 0 1 ...

output:

YES
64 17 37 63 84 51 58 66 54 94 7 60 83 76 35 33 2 100 3 44 59 53 9 13 79 52 56 96 92 90 91 62 72 4 57 22 11 55 31 71 88 74 5 99 19 49 61 18 20 47 8 86 89 25 6 67 73 41 97 24 68 32 85 93 98 87 42 82 43 70 36 80 69 77 28 14 16 27 95 40 15 48 65 21 75 1 10 26 45 81 78 34 12 38 39 50 30 23 29 46 
44 ...

result:

ok ok

Test #71:

score: 0
Accepted
time: 3ms
memory: 3912kb

input:

100
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 1 1 1 0 1 1 0 0 1 1 0 1 0 0 1 1 0 0 1 0 1 1 0 1 1 0 1 1 0 0 0 1 1 0 0 0 0 1 0 1 1 1 0 0 ...

output:

YES
100 50 11 32 87 69 26 15 79 48 3 62 40 78 36 29 77 91 24 97 20 28 65 99 54 66 59 2 27 84 41 47 6 4 73 30 21 58 1 10 98 25 19 86 22 96 93 76 90 63 67 82 42 46 16 81 88 74 13 64 75 92 31 8 72 70 23 61 17 68 37 33 85 80 34 12 89 56 14 95 49 60 52 39 83 9 53 57 43 38 5 55 35 45 94 51 7 18 71 44 
6 5...

result:

ok ok

Test #72:

score: 0
Accepted
time: 3ms
memory: 3976kb

input:

100
0 1 0 1 0 1 1 0 0 1 1 1 0 1 0 1 1 1 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 0 0 1 1 0 1 1 0 1 1 1 1 1 0 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 0 0 1 1 1 0 1 1 1 0 0 0 1 0 1 0 1 1 0 0 1 0 0 0 1 1 0 1
1 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 1 1 1 1 0 0 1 1 1 1 0 0 0 0 1 1 0 1 0 1 1 0 1 1 0 0 1 0 0 1 ...

output:

YES
86 44 35 26 4 46 49 16 90 32 13 28 92 95 40 80 72 96 77 61 6 82 37 42 7 75 79 91 24 34 10 43 81 84 41 94 3 63 78 83 45 73 69 59 93 64 2 18 58 38 12 97 39 20 57 17 36 68 53 51 87 25 29 98 99 15 50 33 89 22 8 56 85 9 67 66 71 62 23 14 5 100 47 19 21 88 31 48 30 27 60 11 52 70 76 55 1 74 65 54 
67 ...

result:

ok ok

Test #73:

score: 0
Accepted
time: 0ms
memory: 4000kb

input:

100
0 1 0 1 1 0 1 1 0 0 0 0 0 1 1 0 0 1 1 1 0 1 1 1 1 1 1 0 0 1 1 0 0 1 0 0 1 1 1 1 0 1 1 0 0 0 0 1 1 1 1 1 0 0 1 1 0 1 1 0 0 1 1 1 0 1 1 1 0 0 0 1 1 0 1 0 1 0 1 1 1 1 1 0 1 0 1 0 0 1 0 1 1 1 0 1 1 0 1 0
1 0 0 1 1 0 0 1 0 0 1 0 1 1 0 0 0 1 1 1 1 1 1 0 0 1 1 0 0 0 1 1 0 0 0 0 1 0 1 1 0 1 0 1 1 1 0 0 ...

output:

YES
48 23 11 17 15 2 39 24 16 93 98 61 70 99 37 12 21 27 40 90 25 68 72 13 35 42 64 55 20 45 29 69 52 10 95 66 97 22 65 71 73 26 32 74 85 49 80 41 19 34 60 3 91 18 63 7 30 36 62 8 54 14 86 92 43 44 75 1 56 57 89 96 6 59 67 31 47 88 84 100 94 28 76 53 38 5 82 87 77 46 4 81 9 33 51 58 83 78 79 50 
61 ...

result:

ok ok

Test #74:

score: 0
Accepted
time: 0ms
memory: 3856kb

input:

9
0 0 1 1 1 1 1 1 1
0 0 1 1 1 1 1 1 1
1 1 0 1 1 1 1 1 1
1 1 1 0 1 1 0 1 1
1 1 1 1 0 1 1 1 1
1 1 1 1 1 0 1 1 1
1 1 1 0 1 1 0 1 1
1 1 1 1 1 1 1 0 1
1 1 1 1 1 1 1 1 0

output:

YES
9 8 7 6 4 3 5 2 1 
8 9 7 5 4 3 6 2 1 

result:

ok ok

Test #75:

score: 0
Accepted
time: 1ms
memory: 3808kb

input:

54
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

YES
54 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3 2 1 11 53 
53 52 51 50 49 48 47 46 45 44 43 42 41 39 40 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 11 10 9 8 7 6 5 4 3...

result:

ok ok

Test #76:

score: 0
Accepted
time: 1ms
memory: 3896kb

input:

100
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

YES
100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 
100...

result:

ok ok

Test #77:

score: 0
Accepted
time: 1ms
memory: 3996kb

input:

100
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

YES
100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 77 76 75 74 73 72 71 70 69 68 78 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 45 44 43 42 41 40 39 38 37 36 35 34 33 32 46 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 31 13 12 11 10 9 8 7 6 5 4 3 2 1 
100...

result:

ok ok

Test #78:

score: 0
Accepted
time: 1ms
memory: 3980kb

input:

100
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

YES
100 99 98 97 96 95 93 92 91 90 89 88 87 86 85 83 82 81 79 78 77 76 75 74 73 72 71 69 80 68 67 66 65 64 63 62 61 60 59 84 58 57 56 55 54 53 52 51 50 49 48 47 46 44 43 42 41 40 38 37 33 32 45 70 31 30 29 39 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 36 12 11 94 10 9 8 7 6 5 4 35 3 34 2 1 
100...

result:

ok ok

Test #79:

score: 0
Accepted
time: 0ms
memory: 3796kb

input:

4
0 1 0 1
1 0 0 0
0 0 0 0
1 0 0 0

output:

YES
4 3 1 2 
3 1 4 2 

result:

ok ok

Test #80:

score: 0
Accepted
time: 0ms
memory: 3916kb

input:

89
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0...

output:

NO

result:

ok ok

Test #81:

score: 0
Accepted
time: 1ms
memory: 4004kb

input:

100
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

YES
100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 
1 2...

result:

ok ok

Test #82:

score: 0
Accepted
time: 1ms
memory: 3920kb

input:

100
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

YES
100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 75 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 
1 2...

result:

ok ok

Test #83:

score: 0
Accepted
time: 1ms
memory: 3976kb

input:

100
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

YES
100 99 98 97 96 95 94 93 91 90 89 88 84 83 82 79 76 75 74 73 72 71 67 69 66 64 63 62 61 59 58 57 56 70 55 54 53 52 51 50 49 48 46 45 68 44 43 42 41 40 38 37 36 35 34 33 32 31 30 39 92 77 60 29 28 27 26 25 47 24 80 23 22 86 21 20 19 18 17 16 15 87 14 13 85 12 81 78 11 10 9 8 7 65 6 5 4 3 2 1 
1 2...

result:

ok ok