QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#769545#1834. Eulerian?VermeilWA 2ms3860kbC++171.1kb2024-11-21 18:06:342024-11-21 18:06:34

Judging History

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

  • [2024-11-21 18:06:34]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3860kb
  • [2024-11-21 18:06:34]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pil = pair<int, ll>;


int ask(vector<int> &v){
    cout<<"? "<<(int)v.size()<<" ";
    for (int i: v) cout<<i<<" ";
    cout<<endl;
    int ret;
    cin>>ret;
    return ret;
}


signed main() {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);

    int n;
    cin>>n;
    vector<int> v;
    vector<int> p(n);
    iota(p.begin(), p.end(), 1);
    for (int i=1;i<=n;i++)v.push_back(i);
    int m = ask(v);
    v.clear();
    random_device rd;
    for (int i=0;i<29;i++){
        int e1, e2, ot;
        shuffle(p.begin(), p.end(), default_random_engine(rd()));
        vector<int> v1, v2;
        for (int j=0;j<n/2;j++) v1.push_back(p[j]);
        for (int j=n/2;j<n;j++) v2.push_back(p[j]);
        e1 = ask(v1);
        e2 = ask(v2);
        ot = m - e1 - e2;
        if ((e1 + ot) & 1){
            cout<<"! NO"<<endl;
            return 0;
        }
    }
    cout<<"! YES";

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3512kb

input:

3
2
0
0
0
0
0
1

output:

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

result:

ok correct

Test #2:

score: 0
Accepted
time: 0ms
memory: 3508kb

input:

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

output:

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

result:

ok correct

Test #3:

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

input:

4
3
1
0

output:

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

result:

ok correct

Test #4:

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

input:

4
4
0
1

output:

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

result:

ok correct

Test #5:

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

input:

4
5
1
1
1
1
0
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
0

output:

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

result:

ok correct

Test #6:

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

input:

10
10
3
2
1
3

output:

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

result:

ok correct

Test #7:

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

input:

10
11
2
3
2
1
3
2

output:

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

result:

ok correct

Test #8:

score: 0
Accepted
time: 0ms
memory: 3628kb

input:

100
100
27
25

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: 3860kb

input:

100
256
65
69

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: 1ms
memory: 3584kb

input:

1000
1488
363
388
372
384
351
372
371
365

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: 1ms
memory: 3808kb

input:

1000
11488
2816
2862
2939
2792
2887
2871

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: 2ms
memory: 3716kb

input:

10000
100000
24939
24951

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: 3664kb

input:

10000
99999
24996
24808

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: 3632kb

input:

10
10
3
3

output:

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

result:

wrong answer the participant answered wrong