QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#563382#1834. Eulerian?ydzr00000WA 0ms3948kbC++17850b2024-09-14 10:43:522024-09-14 10:43:53

Judging History

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

  • [2024-09-14 10:43:53]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3948kb
  • [2024-09-14 10:43:52]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
inline int Query(vector<int>vec)
{
	printf("? %d ",(int)vec.size());
	for(auto u: vec)
		printf("%d ",u);
	printf("\n");
	fflush(stdout);
	int x;
	scanf("%d",&x);
	return x;
}
inline void Tell(bool res)
{
	puts(res?"! YES":"! NO");
	fflush(stdout);
}
bool g[10001];
int main(){
	mt19937 rand(time(0));
	
	int n;
	scanf("%d",&n);
	vector<int>A;
	for(int i=1;i<=n;i++)
		A.push_back(i);
	int m=Query(A);
	for(int T=1;T<=29;T++)
	{
		for(int i=1;i<=n;i++)
			g[i]=rand()%2;
		A.clear();
		for(int i=1;i<=n;i++)
			if(!g[i])
				A.push_back(i);
		int x=Query(A);
		A.clear();
		for(int i=1;i<=n;i++)
			if(g[i])
				A.push_back(i);
		int y=Query(A);
		int z=m-x-y;
		if((x&1)||(y&1)||(z&1))
		{
			Tell(false);
			return 0;
		}
	}
	Tell(true);

	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3948kb

input:

3
2
1
0

output:

? 3 1 2 3 
? 2 2 3 
? 1 1 
! NO

result:

ok correct

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3884kb

input:

3
3
1
0

output:

? 3 1 2 3 
? 2 2 3 
? 1 1 
! NO

result:

wrong answer the participant answered wrong