QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#49332#1834. Eulerian?CrysflyWA 7ms3564kbC++171.1kb2022-09-20 10:14:492022-09-20 10:14:51

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-09-20 10:14:51]
  • 评测
  • 测评结果:WA
  • 用时:7ms
  • 内存:3564kb
  • [2022-09-20 10:14:49]
  • 提交

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;
}

详细

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