QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#86969#4218. Hidden GraphfansizheWA 2ms3820kbC++14700b2023-03-11 15:32:102023-03-11 15:32:11

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-11 15:32:11]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3820kb
  • [2023-03-11 15:32:10]
  • 提交

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