QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#126189#6668. Trokutiangry_face0 13ms5860kbC++142.3kb2023-07-18 11:06:162023-07-18 11:06:18

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-18 11:06:18]
  • 评测
  • 测评结果:0
  • 用时:13ms
  • 内存:5860kb
  • [2023-07-18 11:06:16]
  • 提交

answer

#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <iostream>
using namespace std;

const int NR=110;
int f[NR][NR][NR];
int mp[NR][NR];

int check(int x,int y,int z)
{
	int ans=0;
	printf("? %d %d %d\n",x,y,z);
	cout.flush();
	scanf("%d",&ans);
	return ans;
}

int main()
{
	memset(mp,-1,sizeof(mp));
	for(int i=1;i<=6;i++)
	{
		for(int j=i+1;j<=6;j++)
		{
			for(int k=j+1;k<=6;k++)
			{
				printf("? %d %d %d\n",i,j,k);
				cout.flush();
				scanf("%d",&f[i][j][k]);
			}
		}
	}
	for(int s=0;s<(1<<15);s++)
	{
		int cur=0;
		for(int j=1;j<=6;j++)
		{
			for(int k=j+1;k<=6;k++)
			{
				if((s&(1<<cur))==0) mp[j][k]=mp[k][j]=0;
				else mp[j][k]=mp[k][j]=1;
				cur++;
			}
		}
		bool flag=true;
		for(int i=1;i<=6;i++)
		{
			for(int j=i+1;j<=6;j++)
			{
				for(int k=j+1;k<=6;k++)
				{
					int now=0;
					if(mp[i][j]==1) now++;
					if(mp[i][k]==1) now++;
					if(mp[j][k]==1) now++;
					if(now!=f[i][j][k]) flag=false;
				}
			}
		}
		if(flag==true) break;
	}
	for(int i=7;i<=100;i++)
	{
		for(int j=1;j<=i;j++)
		{
			int pre=j++;
			while(true)
			{
				if(j>=i)
				{
					if(mp[i][1]==-1)
					{
						int now=check(i,2,3);
						if(now==0)
						{
							mp[1][i]=mp[i][1]=1;
							for(int k=2;k<i;k++) mp[i][k]=mp[k][i]=0;
						}
						else
						{
							mp[1][i]=mp[i][1]=0;
							for(int k=2;k<i;k++) mp[i][k]=mp[k][i]=1;
						}
					}
					else
					{
						int now=check(i,1,i-1);
						mp[i][i-1]=mp[i-1][i]=now-mp[1][i-1]-mp[1][i];
						for(int k=pre;k<i-1;k++) mp[i][k]=mp[k][i]=1-mp[i][i-1];
					}
					break;
				}
				int now=check(i,pre,j);
				if(now-mp[pre][j]==0||now-mp[pre][j]==2)
				{
					if(now-mp[pre][j]==0)
					{
						mp[pre][i]=mp[i][pre]=mp[i][j]=mp[j][i]=0;
						for(int k=pre+1;k<j;k++) mp[i][k]=mp[k][i]=1;
					}
					else
					{
						mp[pre][i]=mp[i][pre]=mp[i][j]=mp[j][i]=1;
						for(int k=pre+1;k<j;k++) mp[i][k]=mp[k][i]=0;
					}
					break;
				}
				else j++;
			}
			
		}
	}
	printf("!\n");
	for(int i=1;i<=100;i++)
	{
		for(int j=1;j<=100;j++)
		{
			if(mp[i][j]==-1) printf("0");
			else printf("%d",mp[i][j]);
		}
		puts("");
	}
	return 0;
} 

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 100
Accepted
time: 8ms
memory: 3700kb

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

result:

points 1.0 points  1.0 correct 2558 queries

Test #2:

score: 100
Accepted
time: 13ms
memory: 5860kb

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

result:

points 1.0 points  1.0 correct 2558 queries

Test #3:

score: 0
Wrong Answer
time: 4ms
memory: 3724kb

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

result:

wrong answer the graph you report is incorrect