QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#107407#6109. Similarity GraphCrysflyAC ✓12ms3952kbC++171.7kb2023-05-21 11:10:102023-05-21 11:10:11

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-21 11:10:11]
  • 评测
  • 测评结果:AC
  • 用时:12ms
  • 内存:3952kb
  • [2023-05-21 11:10:10]
  • 提交

answer

#include<bits/stdc++.h>
#define For(i,a,b) for(int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(int i=(a);i>=(b);--i)
using namespace std;
inline int read()
{
	char c=getchar();int x=0;bool f=0;
	for(;!isdigit(c);c=getchar())f^=!(c^45);
	for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+(c^48);
	if(f)x=-x;return x;
}

#define fi first
#define se second
#define pb push_back
#define mkp make_pair
typedef pair<int,int>pii;
typedef vector<int>vi;

#define maxn 400005
#define inf 0x3f3f3f3f

int n,g[405][405],m,id[405][405];

int fa[maxn];
int getf(int x){
	while(x^fa[x])x=fa[x]=fa[fa[x]];
	return x;
}
void merge(int x,int y){
	if(x<y)swap(x,y);
	x=getf(x),y=getf(y);
	if(x!=y)fa[x]=y;
}
bool vis[405][405];
int ans[maxn],p[405],q[405],deg[405],degq[405];

signed main()
{
	n=read();
	For(i,1,n)
		For(j,i+1,n)
			id[i][j]=++m,id[j][i]=m+n*(n-1)/2;
	iota(fa+1,fa+m*2+1,1);
	For(i,1,n)For(j,1,n)g[i][j]=read();
	For(i,1,n)
		For(j,1,n)if(i!=j)
			For(k,1,n)if(k!=i&&k!=j){
				if(g[i][j]==g[j][k] && g[i][j]!=g[i][k]){
				//	cout<<"i,j,k "<<i<<" "<<j<<" "<<k<<endl;
					merge(id[i][j],id[k][j]);
					merge(id[j][i],id[j][k]);
				}
			}
	For(i,1,m) if(getf(i)==getf(i+m)) puts("NO"),exit(0);
	puts("YES");
	For(i,1,n) p[i]=i;
	For(i,1,m+m) ans[i]=-1;
	For(i,1,m)
		if(ans[i]==-1 && getf(i)==i){
			ans[i]=1;
			ans[getf(i+m)]=0;
		}
	For(i,1,n)
		For(j,1,n){
			if(i==j)continue;
			int dir=ans[getf(id[i][j])];
			deg[i]+=dir;
		}
	For(i,1,n) p[i]=deg[i]+1,q[i]=1;
	For(i,1,n)
		For(j,i+1,n){
			int dq=(!g[i][j])^(p[i]>p[j]);
			q[i]+=dq;
			q[j]+=(!dq);
		}
	For(i,1,n)cout<<p[i]<<" \n"[i==n];
	For(i,1,n)cout<<q[i]<<" \n"[i==n];
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 3ms
memory: 3380kb

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: 2ms
memory: 3356kb

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: 2ms
memory: 3232kb

input:

1
0

output:

YES
1
1

result:

ok ok

Test #4:

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

input:

2
0 0
0 0

output:

YES
2 1
1 2

result:

ok ok

Test #5:

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

input:

2
0 1
1 0

output:

YES
2 1
2 1

result:

ok ok

Test #6:

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

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: 1ms
memory: 3352kb

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: 1ms
memory: 3348kb

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: 2ms
memory: 3352kb

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: 1ms
memory: 3376kb

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: 1ms
memory: 3564kb

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: 2ms
memory: 3364kb

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: 2ms
memory: 3300kb

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: 3560kb

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: 3540kb

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: 3348kb

input:

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

output:

YES
3 2 4 1
4 1 2 3

result:

ok ok

Test #17:

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

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: 2ms
memory: 3564kb

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: 2ms
memory: 3516kb

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: 2ms
memory: 3368kb

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: 2ms
memory: 3516kb

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: 2ms
memory: 3420kb

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: 3352kb

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
3 2 5 4 1
5 1 2 3 4

result:

ok ok

Test #24:

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

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
1 5 4 3 2 6
4 3 6 2 1 5

result:

ok ok

Test #25:

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

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: 2ms
memory: 3384kb

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: 2ms
memory: 3360kb

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
4 6 2 5 3 1
1 2 6 5 3 4

result:

ok ok

Test #28:

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

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: 2ms
memory: 3372kb

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
5 2 7 1 4 6 3
7 1 2 6 5 4 3

result:

ok ok

Test #30:

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

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: 2ms
memory: 3336kb

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: 3352kb

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: 2ms
memory: 3548kb

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
5 1 7 2 3 4 6
7 6 3 1 5 2 4

result:

ok ok

Test #34:

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

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 4 7 2 5 3 6 1
1 3 7 2 8 4 6 5

result:

ok ok

Test #35:

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

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
6 8 11 9 7 10 5 3 1 12 4 2
6 12 5 9 1 4 2 3 8 7 10 11

result:

ok ok

Test #36:

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

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
9 11 3 10 2 7 13 6 12 1 5 4 8
11 9 4 3 5 10 6 13 7 1 2 8 12

result:

ok ok

Test #37:

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

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 5 7 11 4 16 1 9 14 12 2 13 3 8 6 15 10
17 1 6 10 9 3 16 13 5 14 11 8 7 12 4 2 15

result:

ok ok

Test #38:

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

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
4 13 16 21 19 12 22 11 23 20 3 10 14 15 6 1 5 7 2 8 17 9 24 18
5 14 12 3 8 23 9 22 20 4 21 24 18 11 2 1 17 6 16 15 7 13 10 19

result:

ok ok

Test #39:

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

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
10 25 24 27 12 6 17 5 9 11 7 18 20 19 3 15 1 8 21 16 22 13 2 26 14 4 23
9 22 14 21 1 7 23 17 25 5 4 8 12 19 27 13 26 10 24 11 15 18 2 16 20 3 6

result:

ok ok

Test #40:

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

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
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
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

result:

ok ok

Test #41:

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

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

result:

ok ok

Test #42:

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

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: 0ms
memory: 3696kb

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 1...

result:

ok ok

Test #44:

score: 0
Accepted
time: 4ms
memory: 3456kb

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

result:

ok ok

Test #45:

score: 0
Accepted
time: 4ms
memory: 3592kb

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

result:

ok ok

Test #46:

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

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
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 23 61 33 44 50 38 10 53 7 2 5 47 68 56 1 18 32 19 69 21 30 17 31 63 45 41 29 51 55 60 34 57 62 22 52 48 8 4 40 71 28 20 13 42 66 15 16
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 58 67 65 54 29 49...

result:

ok ok

Test #47:

score: 0
Accepted
time: 6ms
memory: 3528kb

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
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 43 52 2 8 3 75 13 18 48 51 17 46 35 64 65 15 31 42 19 77 59 53 74 67 70 40 38 36 6 63 28 76 57 1 50 41 11 71 37 25 20 56 60 32 58 66 12 14 68 62 69
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 4...

result:

ok ok

Test #48:

score: 0
Accepted
time: 7ms
memory: 3544kb

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 19...

result:

ok ok

Test #49:

score: 0
Accepted
time: 7ms
memory: 3832kb

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

result:

ok ok

Test #50:

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

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

result:

ok ok

Test #51:

score: 0
Accepted
time: 8ms
memory: 3832kb

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

result:

ok ok

Test #52:

score: 0
Accepted
time: 8ms
memory: 3648kb

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

result:

ok ok

Test #53:

score: 0
Accepted
time: 8ms
memory: 3924kb

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: 9ms
memory: 3896kb

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 50...

result:

ok ok

Test #55:

score: 0
Accepted
time: 12ms
memory: 3660kb

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

result:

ok ok

Test #56:

score: 0
Accepted
time: 9ms
memory: 3716kb

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 60...

result:

ok ok

Test #57:

score: 0
Accepted
time: 4ms
memory: 3760kb

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: 9ms
memory: 3732kb

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

result:

ok ok

Test #59:

score: 0
Accepted
time: 10ms
memory: 3952kb

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

result:

ok ok

Test #60:

score: 0
Accepted
time: 8ms
memory: 3668kb

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: 9ms
memory: 3720kb

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: 12ms
memory: 3912kb

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: 7ms
memory: 3656kb

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: 6ms
memory: 3944kb

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 7...

result:

ok ok

Test #65:

score: 0
Accepted
time: 10ms
memory: 3952kb

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

result:

ok ok

Test #66:

score: 0
Accepted
time: 10ms
memory: 3632kb

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 4...

result:

ok ok

Test #67:

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

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

result:

ok ok

Test #68:

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

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

result:

ok ok

Test #69:

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

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 1...

result:

ok ok

Test #70:

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

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

result:

ok ok

Test #71:

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

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 58...

result:

ok ok

Test #72:

score: 0
Accepted
time: 10ms
memory: 3760kb

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

result:

ok ok

Test #73:

score: 0
Accepted
time: 10ms
memory: 3724kb

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

result:

ok ok

Test #74:

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

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: 0ms
memory: 3748kb

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: 0ms
memory: 3952kb

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: 3ms
memory: 3760kb

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: 3ms
memory: 3892kb

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: 2ms
memory: 3560kb

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: 3ms
memory: 3648kb

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: 4ms
memory: 3688kb

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: 3ms
memory: 3944kb

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: 4ms
memory: 3796kb

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

result:

ok ok