QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#126298#6668. Trokutiangry_face0 28ms3824kbC++142.0kb2023-07-18 12:43:002023-07-18 12:43:01

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 12:43:01]
  • 评测
  • 测评结果:0
  • 用时:28ms
  • 内存:3824kb
  • [2023-07-18 12:43:00]
  • 提交

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],c[NR*NR];

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

int main()
{
	for(int i=1;i<=6;i++)
	{
		for(int j=i+1;j<=6;j++)
		{
			for(int k=j+1;k<=6;k++)
			{
				f[i][j][k]=check(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++)
	{
		int cnt=0;
		for(int j=1;j<=i-2;j++)
		{
			c[++cnt]=check(i,j,j+1)-mp[j][j+1];
			if(c[cnt]==1) continue;
			if(c[cnt]==2) mp[i][j]=mp[j][i]=mp[j+1][i]=mp[i][j+1]=1;
			int now=j-1;
			for(int k=cnt-1;k>=1;k--) if(c[k]>mp[now+1][i]) mp[now][i]=mp[i][now--]=1;
			j++;
			if(j==i-2) if(check(i-2,i-1,i)-mp[i-2][i-1]-mp[i-2][i]!=0) mp[i-1][i]=mp[i][i-1]=1;
		}
		if(cnt!=0)
		{
			if(cnt%2==1)
			{
				if(check(i,i-1,i-cnt)-mp[i-1][i-cnt]==2) mp[i][i-1]=mp[i-1][i]=1;
				cnt++;
				int now=i-2;
				for(int k=cnt-1;k>=1;k--) if(c[k]>mp[now+1][i]) mp[now][i]=mp[i][now--]=1;
			}
			else
			{
				if(check(i,i-1,i-cnt-1)-mp[i-1][i-cnt-1]==2) mp[i][i-1]=mp[i-1][i]=1;
				cnt++;
				int now=i-2;
				for(int k=cnt-1;k>=1;k--) if(c[k]>mp[now+1][i]) mp[now][i]=mp[i][now--]=1;
			}
		}
	}
	printf("!\n");
	for(int i=1;i<=100;i++)
	{
		for(int j=1;j<=100;j++)
		{
			printf("%d",mp[i][j]);
		}
		puts("");
	}
	return 0;
} 

详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 100
Accepted
time: 2ms
memory: 3824kb

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

result:

points 1.0 points  1.0 correct 2605 queries

Test #2:

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

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

result:

points 1.0 points  1.0 correct 2605 queries

Test #3:

score: 0
Wrong Answer
time: 28ms
memory: 3668kb

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

result:

wrong answer the graph you report is incorrect