QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#563382 | #1834. Eulerian? | ydzr00000 | WA | 0ms | 3948kb | C++17 | 850b | 2024-09-14 10:43:52 | 2024-09-14 10:43:53 |
Judging History
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