QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#86969 | #4218. Hidden Graph | fansizhe | WA | 2ms | 3820kb | C++14 | 700b | 2023-03-11 15:32:10 | 2023-03-11 15:32:11 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int n,m,k;
int mat[2005][2005];
vector<int> vec[2005];
int main(){
scanf("%d",&n);k=min(2000/n+1,n);
for(int i=1;i<=n;i++){
int ins=0;
for(int j=1;j<=k;j++){
int flag=1,cnt=0;
while(cnt<vec[j].size()){
putchar('?');
for(int x:vec[j])if(!mat[x][i])printf(" %d",x);
printf(" %d\n",i);
fflush(stdout);
int x,y;scanf("%d%d",&x,&y);
if(x<0&&y<0)break;
else{
flag=0;
mat[x^y^i][i]=1;
cnt++;m++;
}
}
if(flag&&!ins)ins=1,vec[j].push_back(i);
}
}
printf("! %d\n",m);
for(int i=1;i<=n;i++)
for(int j=i+1;j<=n;j++)if(mat[i][j])printf("%d %d\n",i,j);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 3820kb
input:
3 -1 -1 -1 -1
output:
? 1 2 ? 1 2 3 ! 0
result:
wrong answer unknown token 3