QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#117017#6668. Trokutieyiigjkn#39.393548 44ms8496kbC++142.3kb2023-06-30 12:13:082024-05-31 18:37:33

Judging History

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

  • [2024-05-31 18:37:33]
  • 评测
  • 测评结果:39.393548
  • 用时:44ms
  • 内存:8496kb
  • [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:13:08]
  • 提交

answer

# include <bits/stdc++.h>
using namespace std;
constexpr int n=100;
int G[110][110],Q[12][3]={{0,1,3},{0,1,4},{0,1,5},{0,2,3},{0,2,4},{0,2,5},{0,4,5},{1,2,3},{1,2,4},{1,2,5},{1,3,5},{2,3,4}};
map<vector<int>,int> mp;
int query(int a,int b,int c)
{
	if(~G[a][b] && ~G[b][c] && ~G[c][a]) return G[a][b]+G[b][c]+G[c][a];
	cout<<"? "<<a<<" "<<b<<" "<<c<<endl;
	int x;cin>>x;
	return x;
}
void query(const vector<int> &V)
{
	vector<int> vec;
	for(int i=0;i<12;i++) vec.push_back(query(V[Q[i][0]],V[Q[i][1]],V[Q[i][2]]));
	int S=mp[vec];
	for(int i=0,p=0;i<6;i++)
		for(int j=0;j<i;j++)
			G[V[i]][V[j]]=G[V[j]][V[i]]=(S>>p++)&1;
}
int main()
{
	for(int i=0;i<(1<<15);i++)
	{
		static int E[6][6];
		for(int j=0,p=0;j<6;j++)
			for(int k=0;k<j;k++)
				E[j][k]=E[k][j]=(i>>p++)&1;
		vector<int> vec;
		for(int j=0;j<12;j++) vec.push_back(E[Q[j][0]][Q[j][1]]+E[Q[j][1]][Q[j][2]]+E[Q[j][2]][Q[j][0]]);
		mp[vec]=i;
	}
	for(int i=1;i<=n;i++) fill(G[i]+1,G[i]+n+1,-1),G[i][i]=0;
	for(int i=1;i+5<=n;i+=6) query({i,i+1,i+2,i+3,i+4,i+5});
	for(int i=1;i+35<=n;i+=36)
	{
		static int id[6][6];
		for(int j=0;j<6;j++)
			for(int k=0;k<6;k++)
				id[j][k]=i+6*j+k;
		for(int j=0;j<6;j++)
			for(int k:{0,1})
			{
				vector<int> V;
				for(int l=0;l<6;l++) V.push_back(id[l][(j+k*l)%6]);
				query(V);
			}
	}
	for(int i=7;i<=n;i++)
	{
		static int a[110];
		vector<int> V;
		for(int j=1;j<i;j++)
			if(G[i][j]==-1) V.push_back(j);
		if(V.empty()) continue;
		int sz=V.size();
		for(int j=0;j+1<sz;j++) a[j]=query(V[j],V[j+1],i)-G[V[j]][V[j+1]] , assert(a[j]>=0 && a[j]<=2);
		auto set=[&](int j,int v){G[i][j]=G[j][i]=v;};
		int p=find(a,a+sz-1,0)-a;
		if(p<sz-1)
		{
			set(V[p],0);set(V[p+1],0);
			for(int j=p+2;j<sz;j++) set(V[j],a[j-1]-G[i][V[j-1]]);
			for(int j=p-1;j>=0;j--) set(V[j],a[j]-G[i][V[j+1]]);
		}
		else
		{
			p=find(a,a+sz-1,2)-a;
			if(p<sz-1)
			{
				set(V[p],1);set(V[p+1],1);
				for(int j=p+2;j<sz;j++) set(V[j],a[j-1]-G[i][V[j-1]]);
				for(int j=p-1;j>=0;j--) set(V[j],a[j]-G[i][V[j+1]]);
			}
			else
			{
				set(V[0],query(V[0],V[2],i)!=G[V[0]][V[2]]);
				for(int j=1;j<sz;j++) set(V[j],a[j-1]-G[i][V[j-1]]);
			}
		}
	}
	cout<<"!\n";
	for(int i=1;i<=n;i++,cout<<"\n")
		for(int j=1;j<=n;j++)
			cout<<G[i][j];
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 39.3935
Acceptable Answer

Test #1:

score: 39.6645
Acceptable Answer
time: 23ms
memory: 8496kb

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

result:

points 0.39664516130 points  0.39664516130 correct 4736 queries

Test #2:

score: 39.6645
Acceptable Answer
time: 29ms
memory: 8200kb

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

result:

points 0.39664516130 points  0.39664516130 correct 4736 queries

Test #3:

score: 39.6645
Acceptable Answer
time: 37ms
memory: 8112kb

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

result:

points 0.39664516130 points  0.39664516130 correct 4736 queries

Test #4:

score: 39.6645
Acceptable Answer
time: 28ms
memory: 8316kb

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

result:

points 0.39664516130 points  0.39664516130 correct 4736 queries

Test #5:

score: 39.6645
Acceptable Answer
time: 35ms
memory: 8496kb

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

result:

points 0.39664516130 points  0.39664516130 correct 4736 queries

Test #6:

score: 39.6645
Acceptable Answer
time: 19ms
memory: 8496kb

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

result:

points 0.39664516130 points  0.39664516130 correct 4736 queries

Test #7:

score: 39.6645
Acceptable Answer
time: 25ms
memory: 8496kb

input:

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

output:

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

result:

points 0.39664516130 points  0.39664516130 correct 4736 queries

Test #8:

score: 39.6645
Acceptable Answer
time: 16ms
memory: 8256kb

input:

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

output:

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

result:

points 0.39664516130 points  0.39664516130 correct 4736 queries

Test #9:

score: 39.3935
Acceptable Answer
time: 35ms
memory: 8252kb

input:

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

output:

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

result:

points 0.39393548390 points  0.39393548390 correct 4742 queries

Test #10:

score: 39.6645
Acceptable Answer
time: 19ms
memory: 8264kb

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

result:

points 0.39664516130 points  0.39664516130 correct 4736 queries

Test #11:

score: 39.6194
Acceptable Answer
time: 22ms
memory: 8452kb

input:

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

output:

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

result:

points 0.39619354840 points  0.39619354840 correct 4737 queries

Test #12:

score: 39.6194
Acceptable Answer
time: 26ms
memory: 8152kb

input:

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

output:

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

result:

points 0.39619354840 points  0.39619354840 correct 4737 queries

Test #13:

score: 39.6194
Acceptable Answer
time: 44ms
memory: 8200kb

input:

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

output:

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

result:

points 0.39619354840 points  0.39619354840 correct 4737 queries

Test #14:

score: 39.6194
Acceptable Answer
time: 24ms
memory: 8120kb

input:

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

output:

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

result:

points 0.39619354840 points  0.39619354840 correct 4737 queries

Test #15:

score: 39.6645
Acceptable Answer
time: 23ms
memory: 8252kb

input:

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

output:

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

result:

points 0.39664516130 points  0.39664516130 correct 4736 queries

Test #16:

score: 39.6645
Acceptable Answer
time: 25ms
memory: 8260kb

input:

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

output:

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

result:

points 0.39664516130 points  0.39664516130 correct 4736 queries

Test #17:

score: 39.6645
Acceptable Answer
time: 20ms
memory: 8156kb

input:

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

output:

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

result:

points 0.39664516130 points  0.39664516130 correct 4736 queries

Test #18:

score: 39.6194
Acceptable Answer
time: 24ms
memory: 8252kb

input:

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

output:

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

result:

points 0.39619354840 points  0.39619354840 correct 4737 queries

Test #19:

score: 39.6194
Acceptable Answer
time: 21ms
memory: 8256kb

input:

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

output:

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

result:

points 0.39619354840 points  0.39619354840 correct 4737 queries

Test #20:

score: 39.6645
Acceptable Answer
time: 21ms
memory: 8252kb

input:

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

output:

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

result:

points 0.39664516130 points  0.39664516130 correct 4736 queries