QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#126299 | #6668. Trokuti | angry_face | 0 | 9ms | 3852kb | C++14 | 2.0kb | 2023-07-18 12:43:54 | 2023-07-18 12:43:54 |
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],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<=5;i++)
{
for(int j=i+1;j<=5;j++)
{
for(int k=j+1;k<=5;k++)
{
f[i][j][k]=check(i,j,k);
}
}
}
for(int s=0;s<(1<<10);s++)
{
int cur=0;
for(int j=1;j<=5;j++)
{
for(int k=j+1;k<=5;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<=5;i++)
{
for(int j=i+1;j<=5;j++)
{
for(int k=j+1;k<=5;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=6;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;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 100
Accepted
time: 9ms
memory: 3756kb
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 3 4 ? 1 3 5 ? 1 4 5 ? 2 3 4 ? 2 3 5 ? 2 4 5 ? 3 4 5 ? 6 1 2 ? 6 3 4 ? 4 5 6 ? 6 5 3 ? 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 ? 10 7 8 ? 8 9 10 ? 10 9 5 ? 11 1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