QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#49332 | #1834. Eulerian? | Crysfly | WA | 7ms | 3564kb | C++17 | 1.1kb | 2022-09-20 10:14:49 | 2022-09-20 10:14:51 |
Judging History
answer
// what is matter? never mind.
#include<bits/stdc++.h>
#define For(i,a,b) for(int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(int i=(a);i>=(b);--i)
//#define int long long
using namespace std;
inline int read()
{
char c=getchar();int x=0;bool f=0;
for(;!isdigit(c);c=getchar())f^=!(c^45);
for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+(c^48);
if(f)x=-x;return x;
}
#define fi first
#define se second
#define pb push_back
#define mkp make_pair
typedef pair<int,int>pii;
typedef vector<int>vi;
#define maxn 500005
#define inf 0x3f3f3f3f
int n,a[maxn];
mt19937 rnd(19890535);
signed main()
{
cin>>n;
cout<<"? "<<n;
For(i,1,n)cout<<" "<<i;cout<<endl;
int alls;cin>>alls;
For(i,1,59){
int cnt=0,s1=0,s2=0;
for(int i=0;i<n;i+=32){
unsigned x=rnd();
for(int j=0;j<32&&i+j<n;++j)cnt+=a[i+j]=x>>j&1;
}
cout<<"? "<<cnt;
For(i,0,n-1)if(a[i])cout<<" "<<i+1;
cout<<endl;
cin>>s1;
cout<<"? "<<n-cnt;
For(i,0,n-1)if(!a[i])cout<<" "<<i+1;
cout<<endl;
cin>>s2;
if((alls-s1-s2)%2){
cout<<"! NO";
cout<<endl;
exit(0);
}
}
cout<<"! YES";cout<<endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3564kb
input:
3 2 0 0 0 1
output:
? 3 1 2 3 ? 1 2 ? 2 1 3 ? 1 1 ? 2 2 3 ! NO
result:
ok correct
Test #2:
score: -100
Wrong Answer
time: 7ms
memory: 3436kb
input:
3 3 0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 1 0 0 3 1 0 0 1 0 1 0 1 1 0 0 1 0 1 1 0 1 0 0 1 1 0 0 1 0 1 1 0 0 1 3 0 0 1 0 1 0 1 0 -1
output:
? 3 1 2 3 ? 1 2 ? 2 1 3 ? 1 1 ? 2 2 3 ? 1 1 ? 2 2 3 ? 1 2 ? 2 1 3 ? 2 1 2 ? 1 3 ? 2 1 2 ? 1 3 ? 2 2 3 ? 1 1 ? 2 1 2 ? 1 3 ? 2 2 3 ? 1 1 ? 0 ? 3 1 2 3 ? 2 2 3 ? 1 1 ? 1 1 ? 2 2 3 ? 1 3 ? 2 1 2 ? 1 1 ? 2 2 3 ? 2 1 3 ? 1 2 ? 1 3 ? 2 1 2 ? 1 1 ? 2 2 3 ? 2 1 3 ? 1 2 ? 2 2 3 ? 1 1 ? 1 3 ? 2 1 2 ? 2 1 3 ? ...
result:
wrong output format Unexpected end of file - token expected