QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#126183 | #6668. Trokuti | angry_face | 0 | 1ms | 3856kb | C++14 | 2.4kb | 2023-07-18 11:03:20 | 2023-07-18 11:03:22 |
Judging History
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)
{
//if(x==y||y==z||z==x) printf("sjfsdlkfjsflkjsdflksjflsdjfslkfjsdlkjfsdlkfjsdlkfjdsfljsdflkjsdfldksjf");
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();
f[i][j][k]=0;
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: 0
Wrong Answer
time: 1ms
memory: 3856kb
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 Token parameter [name=ans_i] equals to "0", doesn't correspond to pattern "[01]{100,100}"