QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#49334 | #1834. Eulerian? | Crysfly | WA | 1ms | 3576kb | C++17 | 1.1kb | 2022-09-20 10:16:11 | 2022-09-20 10:16:14 |
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(_,1,30){
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;
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3556kb
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: 0ms
memory: 3576kb
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