QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#49334#1834. Eulerian?CrysflyWA 1ms3576kbC++171.1kb2022-09-20 10:16:112022-09-20 10:16:14

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:16:14]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3576kb
  • [2022-09-20 10:16:11]
  • 提交

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

Details

Tip: Click on the bar to expand more detailed information

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