QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#117111#6668. Trokutitricyzhkx#71.683871 13ms4276kbC++142.4kb2023-06-30 12:57:162024-05-31 18:42:38

Judging History

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

  • [2024-05-31 18:42:38]
  • 评测
  • 测评结果:71.683871
  • 用时:13ms
  • 内存:4276kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-06-30 12:57:16]
  • 提交

answer

# include <bits/stdc++.h>
using namespace std;
const int N=100;
typedef vector<int> vi;
int G[110][110],id[10][10],a[110],Q[20][3];
map<vector<int>,int> mp;
mt19937 Rand(0);
int query(int a,int b,int c)
{
	printf("? %d %d %d\n",a,b,c);fflush(stdout);
	int x;scanf("%d",&x);
	return x;
}
int query2(int a,int b,int c){return query(a,b,c)-G[b][c];}
vi Set(int l,int r)
{
	vi T(r-l+1);
	iota(T.begin(),T.end(),l);
	return T;
}
void solve(const vi &S)
{
	assert(S.size()==5);
	vector<int> vec;
	for(int i=0;i<9;i++) vec.push_back(query(S[Q[i][0]],S[Q[i][1]],S[Q[i][2]]));
	int T=mp[vec];
	for(int i=0,k=0;i<5;i++)
		for(int j=0;j<i;j++)
			G[S[i]][S[j]]=G[S[j]][S[i]]=(T>>(k++))&1;
}
void solve2(const vi &S)
{
	assert(S.size()==5*5);
	for(int i=0;i<5;i++)
		for(int j=0;j<5;j++)
		{
			vi T(5);
			for(int k=0;k<5;k++) T[k]=S[5*k+(i*k+j)%5];
			solve(T);
		}
	for(int i=0;i<5;i++)
	{
		vi T(5);
		for(int j=0;j<5;j++) T[j]=S[5*i+j];
		solve(T);
	}
}
void solve3(int u,vi S)
{
	int n=S.size();assert(n&1);
	shuffle(S.begin(),S.end(),Rand);
	vi T;T.push_back(S[0]);T.push_back(S[1]);T.push_back(S[2]);
	fill(a,a+n,-1);
	for(int i=3;i<n;i+=2)
	{
		int t=query2(u,S[i],S[i+1]);
		if(t!=1) G[u][S[i]]=G[S[i]][u]=G[u][S[i+1]]=G[S[i+1]][u]=t/2;
		else a[T.size()]=t,T.push_back(S[i]),T.push_back(S[i+1]);
	}
	swap(S,T);n=S.size();
	for(int i=0;i<n-1;i++)
		if(a[i]<0) a[i]=query2(u,S[i],S[i+1]);
	a[n-1]=query2(u,S[n-1],S[0]);
	int p=-1;
	for(int i=0;i<n;i++)
		if(a[i]!=1) p=i;
	assert(p>=0);
	G[u][S[p]]=G[S[p]][u]=a[p]/2;
	for(int i=p-1;i>=0;i--) G[u][S[i]]=G[S[i]][u]=a[i]-G[u][S[i+1]];
	for(int i=p;i<n-1;i++) G[u][S[i+1]]=G[S[i+1]][u]=a[i]-G[u][S[i]];
}
int main()
{
	int tot=0;
	for(int i=0;i<5;i++)
		for(int j=i+1;j<5;j++)
			for(int k=j+1;k<5;k++)
				Q[tot][0]=i,Q[tot][1]=j,Q[tot][2]=k,tot++;
	for(int i=0,k=0;i<5;i++)
		for(int j=0;j<i;j++)
			id[i][j]=id[j][i]=k++;
	for(int i=0;i<(1<<10);i++)
	{
		vector<int> vec;
		auto g=[&](int u,int v){return (i>>id[u][v])&1;};
		for(int j=0;j<9;j++)
			vec.push_back(g(Q[j][0],Q[j][1])+g(Q[j][1],Q[j][2])+g(Q[j][2],Q[j][0]));
		mp[vec]=i;
	}
	for(int i=1;i<=4;i++) solve2(Set(25*(i-1)+1,25*i));
	for(int i=1;i<4;i++)
		for(int j=i+1;j<=4;j++)
			for(int k=1;k<=25;k++)
				solve3(25*(i-1)+k,Set(25*(j-1)+1,25*j));
	puts("!");
	for(int i=1;i<=N;i++,puts(""))
		for(int j=1;j<=N;j++)
			putchar(G[i][j]+'0');
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 71.6839
Acceptable Answer

Test #1:

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

input:

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

? 1 6 11
? 1 6 16
? 1 6 21
? 1 11 16
? 1 11 21
? 1 16 21
? 6 11 16
? 6 11 21
? 6 16 21
? 2 7 12
? 2 7 17
? 2 7 22
? 2 12 17
? 2 12 22
? 2 17 22
? 7 12 17
? 7 12 22
? 7 17 22
? 3 8 13
? 3 8 18
? 3 8 23
? 3 13 18
? 3 13 23
? 3 18 23
? 8 13 18
? 8 13 23
? 8 18 23
? 4 9 14
? 4 9 19
? 4 9 24
? 4 14 19
? ...

result:

points 1.0 points  1.0 correct 3180 queries

Test #2:

score: 100
Accepted
time: 7ms
memory: 3984kb

input:

3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
...

output:

? 1 6 11
? 1 6 16
? 1 6 21
? 1 11 16
? 1 11 21
? 1 16 21
? 6 11 16
? 6 11 21
? 6 16 21
? 2 7 12
? 2 7 17
? 2 7 22
? 2 12 17
? 2 12 22
? 2 17 22
? 7 12 17
? 7 12 22
? 7 17 22
? 3 8 13
? 3 8 18
? 3 8 23
? 3 13 18
? 3 13 23
? 3 18 23
? 8 13 18
? 8 13 23
? 8 18 23
? 4 9 14
? 4 9 19
? 4 9 24
? 4 14 19
? ...

result:

points 1.0 points  1.0 correct 3180 queries

Test #3:

score: 100
Accepted
time: 5ms
memory: 3976kb

input:

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

? 1 6 11
? 1 6 16
? 1 6 21
? 1 11 16
? 1 11 21
? 1 16 21
? 6 11 16
? 6 11 21
? 6 16 21
? 2 7 12
? 2 7 17
? 2 7 22
? 2 12 17
? 2 12 22
? 2 17 22
? 7 12 17
? 7 12 22
? 7 17 22
? 3 8 13
? 3 8 18
? 3 8 23
? 3 13 18
? 3 13 23
? 3 18 23
? 8 13 18
? 8 13 23
? 8 18 23
? 4 9 14
? 4 9 19
? 4 9 24
? 4 14 19
? ...

result:

points 1.0 points  1.0 correct 3181 queries

Test #4:

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

input:

3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
...

output:

? 1 6 11
? 1 6 16
? 1 6 21
? 1 11 16
? 1 11 21
? 1 16 21
? 6 11 16
? 6 11 21
? 6 16 21
? 2 7 12
? 2 7 17
? 2 7 22
? 2 12 17
? 2 12 22
? 2 17 22
? 7 12 17
? 7 12 22
? 7 17 22
? 3 8 13
? 3 8 18
? 3 8 23
? 3 13 18
? 3 13 23
? 3 18 23
? 8 13 18
? 8 13 23
? 8 18 23
? 4 9 14
? 4 9 19
? 4 9 24
? 4 14 19
? ...

result:

points 1.0 points  1.0 correct 3181 queries

Test #5:

score: 100
Accepted
time: 7ms
memory: 3980kb

input:

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

? 1 6 11
? 1 6 16
? 1 6 21
? 1 11 16
? 1 11 21
? 1 16 21
? 6 11 16
? 6 11 21
? 6 16 21
? 2 7 12
? 2 7 17
? 2 7 22
? 2 12 17
? 2 12 22
? 2 17 22
? 7 12 17
? 7 12 22
? 7 17 22
? 3 8 13
? 3 8 18
? 3 8 23
? 3 13 18
? 3 13 23
? 3 18 23
? 8 13 18
? 8 13 23
? 8 18 23
? 4 9 14
? 4 9 19
? 4 9 24
? 4 14 19
? ...

result:

points 1.0 points  1.0 correct 3184 queries

Test #6:

score: 100
Accepted
time: 10ms
memory: 3980kb

input:

3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
...

output:

? 1 6 11
? 1 6 16
? 1 6 21
? 1 11 16
? 1 11 21
? 1 16 21
? 6 11 16
? 6 11 21
? 6 16 21
? 2 7 12
? 2 7 17
? 2 7 22
? 2 12 17
? 2 12 22
? 2 17 22
? 7 12 17
? 7 12 22
? 7 17 22
? 3 8 13
? 3 8 18
? 3 8 23
? 3 13 18
? 3 13 23
? 3 18 23
? 8 13 18
? 8 13 23
? 8 18 23
? 4 9 14
? 4 9 19
? 4 9 24
? 4 14 19
? ...

result:

points 1.0 points  1.0 correct 3186 queries

Test #7:

score: 83.9226
Acceptable Answer
time: 0ms
memory: 3972kb

input:

0
0
1
1
0
0
1
1
1
1
0
1
0
1
0
1
3
1
0
2
0
2
0
1
2
0
1
0
1
0
1
0
1
2
0
2
0
0
1
0
1
1
0
0
0
2
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
0
0
0
1
1
1
1
0
2
2
2
1
1
1
2
1
1
0
1
1
1
0
1
0
1
1
1
1
0
1
2
1
0
0
1
1
0
2
1
1
2
1
1
1
1
2
2
2
2
0
2
2
1
2
2
1
0
1
1
0
0
0
1
1
2
2
1
1
1
0
0
2
1
0
1
0
1
0
1
1
1
3
2
0
1
0
1
1
1
...

output:

? 1 6 11
? 1 6 16
? 1 6 21
? 1 11 16
? 1 11 21
? 1 16 21
? 6 11 16
? 6 11 21
? 6 16 21
? 2 7 12
? 2 7 17
? 2 7 22
? 2 12 17
? 2 12 22
? 2 17 22
? 7 12 17
? 7 12 22
? 7 17 22
? 3 8 13
? 3 8 18
? 3 8 23
? 3 13 18
? 3 13 23
? 3 18 23
? 8 13 18
? 8 13 23
? 8 18 23
? 4 9 14
? 4 9 19
? 4 9 24
? 4 14 19
? ...

result:

points 0.83922580650 points  0.83922580650 correct 3756 queries

Test #8:

score: 77.5548
Acceptable Answer
time: 5ms
memory: 4264kb

input:

1
1
1
2
2
1
0
2
1
0
0
0
1
1
1
1
1
1
1
1
1
1
2
2
1
2
0
2
3
2
2
3
2
1
1
1
0
0
0
0
1
0
0
1
0
2
2
2
3
2
2
3
2
2
1
1
0
1
2
1
1
1
2
0
0
0
0
1
0
0
1
0
1
0
1
2
2
0
1
2
1
0
1
1
2
0
1
1
1
1
1
0
0
1
1
0
0
0
0
2
0
0
1
2
1
1
2
1
1
1
0
0
1
1
2
2
2
1
1
1
2
1
3
2
1
1
0
1
2
1
1
1
2
1
2
0
0
0
1
1
0
1
1
0
0
1
0
2
0
1
...

output:

? 1 6 11
? 1 6 16
? 1 6 21
? 1 11 16
? 1 11 21
? 1 16 21
? 6 11 16
? 6 11 21
? 6 16 21
? 2 7 12
? 2 7 17
? 2 7 22
? 2 12 17
? 2 12 22
? 2 17 22
? 7 12 17
? 7 12 22
? 7 17 22
? 3 8 13
? 3 8 18
? 3 8 23
? 3 13 18
? 3 13 23
? 3 18 23
? 8 13 18
? 8 13 23
? 8 18 23
? 4 9 14
? 4 9 19
? 4 9 24
? 4 14 19
? ...

result:

points 0.77554838710 points  0.77554838710 correct 3897 queries

Test #9:

score: 100
Accepted
time: 5ms
memory: 3976kb

input:

2
2
2
2
2
2
0
0
0
1
1
1
1
1
1
3
3
3
3
3
3
2
2
3
2
2
3
0
0
0
1
1
0
1
1
0
2
2
2
2
2
3
0
0
1
3
3
3
2
2
2
2
2
2
1
1
1
1
1
1
3
3
3
2
2
2
2
2
2
0
0
0
0
0
0
0
0
1
0
0
1
2
2
2
3
3
3
1
1
1
3
3
3
2
2
3
2
2
3
0
0
0
0
0
1
0
0
1
2
2
2
3
3
2
1
1
0
0
0
0
0
0
1
0
0
1
3
3
3
3
3
2
3
3
2
2
2
2
3
3
3
1
1
1
0
0
0
0
0
0
...

output:

? 1 6 11
? 1 6 16
? 1 6 21
? 1 11 16
? 1 11 21
? 1 16 21
? 6 11 16
? 6 11 21
? 6 16 21
? 2 7 12
? 2 7 17
? 2 7 22
? 2 12 17
? 2 12 22
? 2 17 22
? 7 12 17
? 7 12 22
? 7 17 22
? 3 8 13
? 3 8 18
? 3 8 23
? 3 13 18
? 3 13 23
? 3 18 23
? 8 13 18
? 8 13 23
? 8 18 23
? 4 9 14
? 4 9 19
? 4 9 24
? 4 14 19
? ...

result:

points 1.0 points  1.0 correct 3180 queries

Test #10:

score: 100
Accepted
time: 5ms
memory: 4040kb

input:

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

? 1 6 11
? 1 6 16
? 1 6 21
? 1 11 16
? 1 11 21
? 1 16 21
? 6 11 16
? 6 11 21
? 6 16 21
? 2 7 12
? 2 7 17
? 2 7 22
? 2 12 17
? 2 12 22
? 2 17 22
? 7 12 17
? 7 12 22
? 7 17 22
? 3 8 13
? 3 8 18
? 3 8 23
? 3 13 18
? 3 13 23
? 3 18 23
? 8 13 18
? 8 13 23
? 8 18 23
? 4 9 14
? 4 9 19
? 4 9 24
? 4 14 19
? ...

result:

points 1.0 points  1.0 correct 3180 queries

Test #11:

score: 72.4516
Acceptable Answer
time: 0ms
memory: 4056kb

input:

3
2
2
2
2
1
1
3
1
0
1
0
0
1
1
1
1
2
1
2
1
1
1
2
2
3
3
2
1
0
2
2
0
3
2
1
1
2
2
0
0
1
1
1
3
0
1
1
1
1
1
2
0
1
3
3
2
2
2
2
2
3
3
2
1
3
1
3
1
0
2
1
0
1
1
2
1
3
1
0
1
1
2
0
2
1
1
3
2
1
3
2
2
2
2
1
3
1
1
2
1
2
1
1
0
0
1
1
2
3
1
1
1
2
2
2
2
2
1
3
0
2
1
1
3
1
2
2
2
1
1
2
1
3
2
2
1
3
1
2
1
2
3
1
2
2
2
2
2
3
...

output:

? 1 6 11
? 1 6 16
? 1 6 21
? 1 11 16
? 1 11 21
? 1 16 21
? 6 11 16
? 6 11 21
? 6 16 21
? 2 7 12
? 2 7 17
? 2 7 22
? 2 12 17
? 2 12 22
? 2 17 22
? 7 12 17
? 7 12 22
? 7 17 22
? 3 8 13
? 3 8 18
? 3 8 23
? 3 13 18
? 3 13 23
? 3 18 23
? 8 13 18
? 8 13 23
? 8 18 23
? 4 9 14
? 4 9 19
? 4 9 24
? 4 14 19
? ...

result:

points 0.7245161290 points  0.7245161290 correct 4010 queries

Test #12:

score: 72.5871
Acceptable Answer
time: 13ms
memory: 3984kb

input:

0
1
1
1
2
1
2
1
1
2
1
2
2
2
2
1
0
1
1
1
1
1
1
0
3
3
2
1
3
1
1
0
1
1
0
1
1
1
1
3
2
3
1
0
1
0
1
2
1
2
1
2
2
2
0
0
1
1
0
1
1
1
2
1
2
1
2
0
2
3
2
3
2
0
1
1
2
1
1
1
0
1
2
2
2
2
2
1
1
0
2
3
1
2
1
2
1
0
2
2
1
1
3
1
2
2
2
2
3
2
2
1
2
0
2
3
2
2
0
0
1
2
0
1
2
0
1
1
0
1
0
1
3
1
2
2
3
2
1
1
2
2
1
1
2
1
1
2
3
1
...

output:

? 1 6 11
? 1 6 16
? 1 6 21
? 1 11 16
? 1 11 21
? 1 16 21
? 6 11 16
? 6 11 21
? 6 16 21
? 2 7 12
? 2 7 17
? 2 7 22
? 2 12 17
? 2 12 22
? 2 17 22
? 7 12 17
? 7 12 22
? 7 17 22
? 3 8 13
? 3 8 18
? 3 8 23
? 3 13 18
? 3 13 23
? 3 18 23
? 8 13 18
? 8 13 23
? 8 18 23
? 4 9 14
? 4 9 19
? 4 9 24
? 4 14 19
? ...

result:

points 0.72587096770 points  0.72587096770 correct 4007 queries

Test #13:

score: 71.9548
Acceptable Answer
time: 9ms
memory: 3972kb

input:

1
1
0
0
1
0
2
2
1
2
2
2
2
1
2
2
3
2
2
3
2
3
2
2
2
2
3
2
2
1
2
1
1
0
0
0
2
1
2
1
2
0
0
2
1
0
2
1
1
2
3
1
1
2
1
1
1
0
0
0
0
0
0
1
3
2
2
0
2
2
1
3
2
1
0
2
1
2
1
1
1
1
1
2
2
3
2
0
2
1
1
1
2
1
2
2
1
1
1
2
2
3
1
1
3
1
2
2
2
2
2
1
1
3
1
1
1
2
2
2
2
2
1
0
2
1
2
3
2
3
1
1
2
1
2
2
2
2
1
3
2
1
1
2
0
0
2
1
1
2
...

output:

? 1 6 11
? 1 6 16
? 1 6 21
? 1 11 16
? 1 11 21
? 1 16 21
? 6 11 16
? 6 11 21
? 6 16 21
? 2 7 12
? 2 7 17
? 2 7 22
? 2 12 17
? 2 12 22
? 2 17 22
? 7 12 17
? 7 12 22
? 7 17 22
? 3 8 13
? 3 8 18
? 3 8 23
? 3 13 18
? 3 13 23
? 3 18 23
? 8 13 18
? 8 13 23
? 8 18 23
? 4 9 14
? 4 9 19
? 4 9 24
? 4 14 19
? ...

result:

points 0.71954838710 points  0.71954838710 correct 4021 queries

Test #14:

score: 72.6774
Acceptable Answer
time: 3ms
memory: 3980kb

input:

3
3
1
2
2
2
2
2
2
1
1
2
1
2
2
1
1
1
1
1
2
1
0
0
1
1
1
1
1
1
3
2
2
1
0
0
3
1
3
1
3
1
1
3
1
2
2
3
1
2
2
1
1
3
1
1
2
0
2
2
2
3
3
2
3
1
3
1
2
2
0
2
2
2
1
1
2
0
1
1
1
2
1
1
1
0
0
2
1
0
2
2
1
2
2
1
0
1
0
1
2
1
2
1
1
1
1
2
3
3
1
2
1
2
2
1
2
0
1
1
2
1
3
1
0
1
2
3
1
1
1
2
2
2
2
1
1
2
1
2
2
1
3
1
1
2
2
2
2
3
...

output:

? 1 6 11
? 1 6 16
? 1 6 21
? 1 11 16
? 1 11 21
? 1 16 21
? 6 11 16
? 6 11 21
? 6 16 21
? 2 7 12
? 2 7 17
? 2 7 22
? 2 12 17
? 2 12 22
? 2 17 22
? 7 12 17
? 7 12 22
? 7 17 22
? 3 8 13
? 3 8 18
? 3 8 23
? 3 13 18
? 3 13 23
? 3 18 23
? 8 13 18
? 8 13 23
? 8 18 23
? 4 9 14
? 4 9 19
? 4 9 24
? 4 14 19
? ...

result:

points 0.72677419350 points  0.72677419350 correct 4005 queries

Test #15:

score: 72.4516
Acceptable Answer
time: 0ms
memory: 3968kb

input:

1
2
2
0
2
2
1
1
2
1
1
2
3
3
3
1
2
2
2
1
2
2
2
0
1
2
1
0
1
1
1
1
2
0
2
2
2
1
1
2
2
0
3
3
2
1
1
0
2
0
1
2
1
0
0
0
1
1
2
2
1
1
1
0
1
1
1
1
0
2
2
2
2
1
3
2
3
2
1
2
2
2
0
1
2
1
1
2
2
2
1
1
0
1
0
1
3
1
2
1
2
0
1
1
1
2
2
1
1
1
1
0
1
1
2
3
3
1
3
2
2
1
2
2
2
3
2
1
3
0
2
1
1
3
1
2
1
2
1
2
1
2
2
2
2
0
1
1
3
2
...

output:

? 1 6 11
? 1 6 16
? 1 6 21
? 1 11 16
? 1 11 21
? 1 16 21
? 6 11 16
? 6 11 21
? 6 16 21
? 2 7 12
? 2 7 17
? 2 7 22
? 2 12 17
? 2 12 22
? 2 17 22
? 7 12 17
? 7 12 22
? 7 17 22
? 3 8 13
? 3 8 18
? 3 8 23
? 3 13 18
? 3 13 23
? 3 18 23
? 8 13 18
? 8 13 23
? 8 18 23
? 4 9 14
? 4 9 19
? 4 9 24
? 4 14 19
? ...

result:

points 0.7245161290 points  0.7245161290 correct 4010 queries

Test #16:

score: 71.6839
Acceptable Answer
time: 3ms
memory: 4276kb

input:

2
1
1
1
3
2
2
2
2
0
0
1
0
0
0
0
1
1
3
2
3
2
2
3
1
2
2
0
2
1
2
1
1
2
2
2
3
2
2
1
2
1
2
3
3
0
1
2
1
1
2
2
1
3
1
1
2
1
3
2
1
2
3
3
3
2
3
3
2
3
2
1
3
1
1
2
2
1
2
2
1
0
1
0
1
1
2
0
1
1
1
2
1
2
2
2
1
2
3
2
2
2
1
1
0
3
3
2
2
2
2
1
0
2
1
2
2
2
3
3
3
3
3
2
2
3
3
2
2
3
3
3
2
2
1
3
2
1
1
1
0
2
1
1
3
2
1
2
1
2
...

output:

? 1 6 11
? 1 6 16
? 1 6 21
? 1 11 16
? 1 11 21
? 1 16 21
? 6 11 16
? 6 11 21
? 6 16 21
? 2 7 12
? 2 7 17
? 2 7 22
? 2 12 17
? 2 12 22
? 2 17 22
? 7 12 17
? 7 12 22
? 7 17 22
? 3 8 13
? 3 8 18
? 3 8 23
? 3 13 18
? 3 13 23
? 3 18 23
? 8 13 18
? 8 13 23
? 8 18 23
? 4 9 14
? 4 9 19
? 4 9 24
? 4 14 19
? ...

result:

points 0.71683870970 points  0.71683870970 correct 4027 queries

Test #17:

score: 74.0774
Acceptable Answer
time: 0ms
memory: 4052kb

input:

3
1
3
2
3
1
2
3
1
1
2
1
2
3
2
1
1
1
1
2
2
1
1
2
0
0
0
0
2
2
1
1
3
1
1
3
3
3
2
2
1
1
2
2
2
0
2
1
1
1
3
1
0
2
2
2
3
2
2
3
0
1
2
1
3
1
2
0
2
2
0
2
1
0
1
2
1
0
1
1
1
1
2
2
3
3
2
2
2
2
1
1
0
2
2
2
0
1
1
3
3
3
2
2
3
2
2
3
3
2
3
3
3
3
2
3
2
2
2
3
1
2
1
3
3
2
2
1
2
1
1
1
2
3
2
0
2
0
1
0
2
1
0
2
1
0
0
1
0
1
...

output:

? 1 6 11
? 1 6 16
? 1 6 21
? 1 11 16
? 1 11 21
? 1 16 21
? 6 11 16
? 6 11 21
? 6 16 21
? 2 7 12
? 2 7 17
? 2 7 22
? 2 12 17
? 2 12 22
? 2 17 22
? 7 12 17
? 7 12 22
? 7 17 22
? 3 8 13
? 3 8 18
? 3 8 23
? 3 13 18
? 3 13 23
? 3 18 23
? 8 13 18
? 8 13 23
? 8 18 23
? 4 9 14
? 4 9 19
? 4 9 24
? 4 14 19
? ...

result:

points 0.74077419350 points  0.74077419350 correct 3974 queries

Test #18:

score: 72.0452
Acceptable Answer
time: 0ms
memory: 4264kb

input:

0
2
1
1
1
1
1
2
2
2
3
2
3
3
3
2
1
2
1
2
0
3
2
1
2
1
1
2
1
2
1
1
2
2
1
1
2
3
2
2
2
1
1
2
2
1
3
2
1
2
2
1
1
1
0
1
1
0
1
1
1
2
3
2
1
1
3
2
3
2
1
1
1
3
1
1
1
1
1
1
1
2
2
2
3
3
3
1
1
1
0
1
1
2
1
1
1
2
1
2
2
1
3
3
2
3
2
1
1
0
2
2
2
2
1
1
2
1
2
3
1
1
2
2
1
3
2
2
3
2
2
1
2
1
2
3
1
3
1
2
1
1
2
1
0
1
1
0
1
2
...

output:

? 1 6 11
? 1 6 16
? 1 6 21
? 1 11 16
? 1 11 21
? 1 16 21
? 6 11 16
? 6 11 21
? 6 16 21
? 2 7 12
? 2 7 17
? 2 7 22
? 2 12 17
? 2 12 22
? 2 17 22
? 7 12 17
? 7 12 22
? 7 17 22
? 3 8 13
? 3 8 18
? 3 8 23
? 3 13 18
? 3 13 23
? 3 18 23
? 8 13 18
? 8 13 23
? 8 18 23
? 4 9 14
? 4 9 19
? 4 9 24
? 4 14 19
? ...

result:

points 0.72045161290 points  0.72045161290 correct 4019 queries

Test #19:

score: 72.8581
Acceptable Answer
time: 0ms
memory: 3988kb

input:

2
3
2
2
1
2
3
1
1
1
1
1
1
1
0
1
1
2
3
3
3
2
2
3
2
2
3
2
1
0
1
1
0
2
1
1
1
1
1
2
1
2
2
1
0
0
2
1
2
1
3
2
0
2
0
1
1
2
0
2
1
1
2
1
2
2
0
1
2
1
0
2
2
2
0
2
1
2
2
1
2
0
0
0
1
1
1
1
1
1
1
1
2
1
2
3
1
3
2
1
2
1
1
1
3
2
1
2
2
3
2
3
1
1
2
1
2
2
3
3
2
2
3
1
1
3
1
0
2
1
3
2
0
2
2
3
1
2
1
1
0
1
2
1
2
3
3
1
2
3
...

output:

? 1 6 11
? 1 6 16
? 1 6 21
? 1 11 16
? 1 11 21
? 1 16 21
? 6 11 16
? 6 11 21
? 6 16 21
? 2 7 12
? 2 7 17
? 2 7 22
? 2 12 17
? 2 12 22
? 2 17 22
? 7 12 17
? 7 12 22
? 7 17 22
? 3 8 13
? 3 8 18
? 3 8 23
? 3 13 18
? 3 13 23
? 3 18 23
? 8 13 18
? 8 13 23
? 8 18 23
? 4 9 14
? 4 9 19
? 4 9 24
? 4 14 19
? ...

result:

points 0.72858064520 points  0.72858064520 correct 4001 queries

Test #20:

score: 73.0839
Acceptable Answer
time: 10ms
memory: 3976kb

input:

2
2
1
3
2
3
3
1
2
2
0
0
1
1
0
1
1
0
3
3
1
3
2
2
3
2
2
2
2
2
1
1
1
3
1
1
2
1
2
1
3
1
0
1
0
1
2
3
2
2
2
1
2
1
2
1
1
1
2
0
0
1
0
3
1
2
2
3
2
2
2
1
1
0
0
2
2
1
1
1
1
1
1
1
1
1
1
3
1
1
0
0
1
0
1
2
0
0
1
3
2
3
2
2
3
1
2
2
1
2
2
2
3
3
1
2
3
1
0
1
1
1
1
2
3
2
0
1
1
1
1
1
2
0
1
1
2
1
1
1
3
2
1
2
2
3
3
2
2
3
...

output:

? 1 6 11
? 1 6 16
? 1 6 21
? 1 11 16
? 1 11 21
? 1 16 21
? 6 11 16
? 6 11 21
? 6 16 21
? 2 7 12
? 2 7 17
? 2 7 22
? 2 12 17
? 2 12 22
? 2 17 22
? 7 12 17
? 7 12 22
? 7 17 22
? 3 8 13
? 3 8 18
? 3 8 23
? 3 13 18
? 3 13 23
? 3 18 23
? 8 13 18
? 8 13 23
? 8 18 23
? 4 9 14
? 4 9 19
? 4 9 24
? 4 14 19
? ...

result:

points 0.73083870970 points  0.73083870970 correct 3996 queries