QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#393828#6109. Similarity GraphNahidameowAC ✓8ms4004kbC++202.1kb2024-04-19 14:05:562024-04-19 14:05:57

Judging History

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

  • [2024-04-19 14:05:57]
  • 评测
  • 测评结果:AC
  • 用时:8ms
  • 内存:4004kb
  • [2024-04-19 14:05:56]
  • 提交

answer

#include<bits/stdc++.h>
#define pd push_back
#define all(A) A.begin(),A.end()
#define lb lower_bound
#define ve std::vector
typedef long long ll;
typedef long long ll;
typedef __int128 Int;
typedef unsigned long long ul;
typedef long double LD;
bool FileIfstream(std::string name){
	std::ifstream f(name.c_str());
	return f.good();
}
namespace Math{
	ll QP(ll x,ll y,ll mod){ll ans=1;for(;y;y>>=1,x=x*x%mod)if(y&1)ans=ans*x%mod;return ans;}
	ll inv(ll x,ll mod){return QP(x,mod-2,mod);}
}
const int N=2e5+10;
const int mod=998244353;
int f[N];
int find(int x){return f[x]==x?x:f[x]=find(f[x]);}
void merge(int x,int y){
	x=find(x),y=find(y);
	if(x==y)return;
	if(x>y)std::swap(x,y);
	f[y]=x;
}
void solve(){
	//don't forget to open long long
	int n;std::cin>>n;
	ve<ve<int>>v(n+1,ve<int>(n+1));
	auto Gid=[&](int x,int y)->int{return (x-1)*n+y;};
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			std::cin>>v[i][j];
	for(int i=1;i<=n*n;i++)f[i]=i;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			for(int k=1;k<=n;k++)
				if(v[i][j]==v[i][k]&&v[i][j]==!v[j][k])
					merge(Gid(i,j),Gid(i,k)),merge(Gid(j,i),Gid(k,i));
	ve<ve<int>>val(n+1,ve<int>(n+1));
	for(int i=1;i<=n;i++)
		for(int j=i+1;j<=n;j++){
			int x=find(Gid(i,j)),y=find(Gid(j,i));
			if(x==y)return std::cout<<"NO\n",void();
			val[i][j]=x<y;val[j][i]=x>y;
		}
	std::cout<<"YES\n",void();
	ve<int>p,q;
	for(int i=1;i<=n;i++)p.pd(i),q.pd(i);
	sort(all(p),[&](auto x,auto y){return val[x][y];});
	sort(all(q),[&](auto x,auto y){return val[x][y]^v[x][y]^1;});
	ve<std::array<int,2>>per(n+1);
	for(int i=1;i<=n;i++)
		per[p[i-1]][0]=i,per[q[i-1]][1]=i;
	for(int i=1;i<=n;i++)std::cout<<per[i][0]<<(i==n?'\n':' ');
	for(int i=1;i<=n;i++)std::cout<<per[i][1]<<(i==n?'\n':' ');
}
int main(){
#ifndef ONLINE_JUDGE
	if(!FileIfstream("IO.in")){
		freopen("IO.in","w",stdout);
		return 0;
	}
	freopen("IO.in","r",stdin);
	freopen("IO.out","w",stdout);
#endif
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	std::cout.tie(0);
	int T=1;
	//std::cin>>T;
	while(T--)solve();

	return 0;
}




詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3872kb

input:

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

output:

YES
1 2 3 4
2 4 1 3

result:

ok ok

Test #2:

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

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

input:

1
0

output:

YES
1
1

result:

ok ok

Test #4:

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

input:

2
0 0
0 0

output:

YES
1 2
2 1

result:

ok ok

Test #5:

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

input:

2
0 1
1 0

output:

YES
1 2
1 2

result:

ok ok

Test #6:

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

input:

3
0 0 0
0 0 0
0 0 0

output:

YES
1 2 3
3 2 1

result:

ok ok

Test #7:

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

input:

3
0 0 0
0 0 1
0 1 0

output:

YES
1 2 3
3 1 2

result:

ok ok

Test #8:

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

input:

3
0 0 1
0 0 0
1 0 0

output:

YES
1 3 2
2 1 3

result:

ok ok

Test #9:

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

input:

3
0 0 1
0 0 1
1 1 0

output:

YES
1 2 3
2 1 3

result:

ok ok

Test #10:

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

input:

3
0 1 0
1 0 0
0 0 0

output:

YES
1 2 3
2 3 1

result:

ok ok

Test #11:

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

input:

3
0 1 0
1 0 1
0 1 0

output:

YES
1 3 2
2 3 1

result:

ok ok

Test #12:

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

input:

3
0 1 1
1 0 0
1 0 0

output:

YES
1 2 3
1 3 2

result:

ok ok

Test #13:

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

input:

3
0 1 1
1 0 1
1 1 0

output:

YES
1 2 3
1 2 3

result:

ok ok

Test #14:

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

input:

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

output:

YES
1 2 3 4
3 2 4 1

result:

ok ok

Test #15:

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

input:

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

output:

YES
1 2 3 4
1 4 3 2

result:

ok ok

Test #16:

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

input:

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

output:

YES
1 4 3 2
2 3 1 4

result:

ok ok

Test #17:

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

input:

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

output:

YES
1 2 3 4
3 4 1 2

result:

ok ok

Test #18:

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

input:

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

output:

YES
1 2 3 4
4 3 1 2

result:

ok ok

Test #19:

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

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

result:

ok ok

Test #20:

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

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

result:

ok ok

Test #21:

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

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

result:

ok ok

Test #22:

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

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

result:

ok ok

Test #23:

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

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

result:

ok ok

Test #24:

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

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

result:

ok ok

Test #25:

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

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

result:

ok ok

Test #26:

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

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

result:

ok ok

Test #27:

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

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

result:

ok ok

Test #28:

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

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

result:

ok ok

Test #29:

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

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

result:

ok ok

Test #30:

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

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

result:

ok ok

Test #31:

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

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

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

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

result:

ok ok

Test #34:

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

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

result:

ok ok

Test #35:

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

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

result:

ok ok

Test #36:

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

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

result:

ok ok

Test #37:

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

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

result:

ok ok

Test #38:

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

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

result:

ok ok

Test #39:

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

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

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

result:

ok ok

Test #41:

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

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

result:

ok ok

Test #42:

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

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

result:

ok ok

Test #43:

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

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

result:

ok ok

Test #44:

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

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

result:

ok ok

Test #45:

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

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
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 65 10 45 54 21 13 18 3 12 34 14 43 39 37 32 64 33 53 61 4 19 2 42 5 35 20 51
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 2...

result:

ok ok

Test #46:

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

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

result:

ok ok

Test #47:

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

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

result:

ok ok

Test #48:

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

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

result:

ok ok

Test #49:

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

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 17 3 22 13 85 23 18 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 14 68 46 42 9 32 82 76 34 4 66 58 38 62 52 43 63 53 31 55 84 21 48 36 25 47 41 51 44 73 67 57 45 81 80 83 49 75 37
45 59 75 41 5 78 50 66 54 26 77 39 27 65 7 17 6...

result:

ok ok

Test #50:

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

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

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 77 82 63 45 61 6 69 5 42 12 64 44 8 59 80 18 54 17 51 66 39 73 10 78 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 65 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: 5ms
memory: 3992kb

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

result:

ok ok

Test #53:

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

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

result:

ok ok

Test #54:

score: 0
Accepted
time: 5ms
memory: 3748kb

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

result:

ok ok

Test #55:

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

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 28 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 29 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: 6ms
memory: 3792kb

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

result:

ok ok

Test #57:

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

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

result:

ok ok

Test #58:

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

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

result:

ok ok

Test #59:

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

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

result:

ok ok

Test #60:

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

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

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

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

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

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

result:

ok ok

Test #65:

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

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

result:

ok ok

Test #66:

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

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

result:

ok ok

Test #67:

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

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

result:

ok ok

Test #68:

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

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 68 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 69 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: 3ms
memory: 4004kb

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

result:

ok ok

Test #70:

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

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

result:

ok ok

Test #71:

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

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

result:

ok ok

Test #72:

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

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

result:

ok ok

Test #73:

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

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 49 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 51
40 6...

result:

ok ok

Test #74:

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

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

result:

ok ok

Test #75:

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

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

result:

ok ok

Test #76:

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

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

result:

ok ok

Test #77:

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

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

result:

ok ok

Test #78:

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

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

result:

ok ok

Test #79:

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

input:

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

output:

YES
1 2 4 3
2 4 1 3

result:

ok ok

Test #80:

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

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

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

result:

ok ok

Test #82:

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

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

result:

ok ok

Test #83:

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

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

result:

ok ok