QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#18725#1834. Eulerian?yuyueWA 4ms3736kbC++171.3kb2022-01-25 18:39:272022-05-06 02:18:34

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-05-06 02:18:34]
  • 评测
  • 测评结果:WA
  • 用时:4ms
  • 内存:3736kb
  • [2022-01-25 18:39:27]
  • 提交

answer

#include<bits/stdc++.h>
#define LL long long
#define pb push_back
#define SZ(x) ((int)x.size()-1)
#define ms(a,b) memset(a,b,sizeof a)
#define F(i,a,b) for (int i=(a);i<=(b);++i)
#define DF(i,a,b) for (int i=(a);i>=(b);--i)
//#define mp make_pair
//#define OO(x) fixed<<setprecision(x)
using namespace std;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
inline int read(){
	char ch=getchar(); int w=1,c=0;
	for(;!isdigit(ch);ch=getchar()) if (ch=='-') w=-1;
	for(;isdigit(ch);ch=getchar()) c=(c<<1)+(c<<3)+(ch^48);
	return w*c;
}
const int M=1e6+10;
int n,m; 
int ask(vector<int> s){
	if (!s.size()) return 0;
	cout<<"? ";
	cout<<s.size()<<" ";
	for (int x:s) cout<<x<<" ";
	cout<<endl;
	int o=read();
	return o;
}
int main(){
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	n=read();
	cout<<"? "<<n;
	F(i,1,n) cout<<" "<<i;
	cout<<endl;
	m=read();
	F(T,1,30){
		vector<int> X,Y;
		F(i,1,n){
			if (rnd()&1) X.pb(i);
			else Y.pb(i);
		}
		if ((m-ask(X)-ask(Y))%2==1){
			cout<<"! NO"<<endl;
			return 0;
		}
	}
	cout<<"! YES"<<endl;
	return 0;
}
/* stuff you should look for
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* WRITE STUFF DOWN
	* DON'T GET STUCK ON ONE APPROACH
*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 4ms
memory: 3624kb

input:

3
2
0
0
0
0
2
1
0

output:

? 3 1 2 3
? 2 1 3 
? 1 2 
? 2 1 3 
? 1 2 
? 3 1 2 3 
? 2 2 3 
? 1 1 
! NO

result:

ok correct

Test #2:

score: 0
Accepted
time: 4ms
memory: 3696kb

input:

3
3
1
0
1
0
0
1
0
1
1
0
1
0
0
1
0
1
0
1
0
1
1
0
0
1
3
1
0
1
0
0
1
3
1
0
0
1
1
0
0
1
0
1
1
0
1
0
3
3
1
0
3
1
0
1
0

output:

? 3 1 2 3
? 2 1 3 
? 1 2 
? 2 1 2 
? 1 3 
? 1 1 
? 2 2 3 
? 1 3 
? 2 1 2 
? 2 1 2 
? 1 3 
? 2 1 3 
? 1 2 
? 1 2 
? 2 1 3 
? 1 2 
? 2 1 3 
? 1 3 
? 2 1 2 
? 1 3 
? 2 1 2 
? 2 2 3 
? 1 1 
? 1 2 
? 2 1 3 
? 3 1 2 3 
? 2 1 3 
? 1 2 
? 2 1 2 
? 1 3 
? 1 2 
? 2 1 3 
? 3 1 2 3 
? 2 2 3 
? 1 1 
? 1 1 
? 2 2...

result:

ok correct

Test #3:

score: 0
Accepted
time: 3ms
memory: 3608kb

input:

4
3
0
2

output:

? 4 1 2 3 4
? 1 1 
? 3 2 3 4 
! NO

result:

ok correct

Test #4:

score: 0
Accepted
time: 3ms
memory: 3652kb

input:

4
4
0
3

output:

? 4 1 2 3 4
? 1 1 
? 3 2 3 4 
! NO

result:

ok correct

Test #5:

score: 0
Accepted
time: 4ms
memory: 3496kb

input:

4
5
2
0

output:

? 4 1 2 3 4
? 3 1 2 3 
? 1 4 
! NO

result:

ok correct

Test #6:

score: 0
Accepted
time: 3ms
memory: 3688kb

input:

10
10
0
8
0
2
0
8
0
9

output:

? 10 1 2 3 4 5 6 7 8 9 10
? 2 1 2 
? 8 3 4 5 6 7 8 9 10 
? 5 1 2 4 8 10 
? 5 3 5 6 7 9 
? 1 8 
? 9 1 2 3 4 5 6 7 9 10 
? 1 2 
? 9 1 3 4 5 6 7 8 9 10 
! NO

result:

ok correct

Test #7:

score: 0
Accepted
time: 3ms
memory: 3624kb

input:

10
11
0
8

output:

? 10 1 2 3 4 5 6 7 8 9 10
? 2 3 4 
? 8 1 2 5 6 7 8 9 10 
! NO

result:

ok correct

Test #8:

score: 0
Accepted
time: 3ms
memory: 3580kb

input:

100
100
23
18

output:

? 100 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
? ...

result:

ok correct

Test #9:

score: 0
Accepted
time: 1ms
memory: 3636kb

input:

100
256
50
83

output:

? 100 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
? ...

result:

ok correct

Test #10:

score: 0
Accepted
time: 4ms
memory: 3660kb

input:

1000
1488
405
374

output:

? 1000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...

result:

ok correct

Test #11:

score: 0
Accepted
time: 4ms
memory: 3632kb

input:

1000
11488
2785
3084

output:

? 1000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...

result:

ok correct

Test #12:

score: 0
Accepted
time: 4ms
memory: 3704kb

input:

10000
100000
24805
25077
24047
25908

output:

? 10000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...

result:

ok correct

Test #13:

score: 0
Accepted
time: 2ms
memory: 3736kb

input:

10000
99999
25004
24929
24697
25147

output:

? 10000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...

result:

ok correct

Test #14:

score: -100
Wrong Answer
time: 0ms
memory: 3556kb

input:

10
10
2
2
4
0
2
2
1
3
3
5
0
4
0
4
2
4
4
0
0
2
2
2
1
1
1
3
2
2
2
2
6
0
0
4
2
0
1
1
3
1
2
2
1
3
1
3
2
4
1
1
2
2
3
3
4
4
3
3
2
-1

output:

? 10 1 2 3 4 5 6 7 8 9 10
? 5 1 4 8 9 10 
? 5 2 3 5 6 7 
? 7 1 2 4 6 7 8 9 
? 3 3 5 10 
? 5 1 3 5 6 9 
? 5 2 4 7 8 10 
? 4 2 3 6 10 
? 6 1 4 5 7 8 9 
? 4 1 5 6 7 
? 6 2 3 4 8 9 10 
? 3 1 3 10 
? 7 2 4 5 6 7 8 9 
? 3 5 6 8 
? 7 1 2 3 4 7 9 10 
? 4 3 4 5 7 
? 6 1 2 6 8 9 10 
? 7 1 2 4 5 6 8 9 
? 3 3 7...

result:

wrong output format Unexpected end of file - token expected