Submission details
Task:Alkuluvut
Sender:ollpu
Submission time:2025-09-26 22:51:36 +0300
Language:C++ (C++20)
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
#30
Test results
testverdicttimegroup
#10.00 s1, 2, 3details
#20.00 s2, 3details
#30.00 s3details

Code

#include <bits/stdc++.h>
using namespace std;
int main() {
    // cout << 1023 << endl;
    // for (int i = 1; i < 1024; ++i) {
    //     cout << __builtin_popcount(i) << " ";
    //     for (int j = 0; j < 10; ++j) {
    //         if (i & (1<<j)) cout << j << " ";
    //     }
    //     cout << "\n";
    // }
    // cout << flush;
    for (int i = 1; i < 1024; ++i) {
        int ds[10]{};
        for (int j = 0; j < 10; ++j) {
            if (i & (1<<j)) ds[j] = 1;
        }
        string ans;
        cin >> ans;
        if (ans == "YES") {
            int z[10]{};
            string ps;
            cin >> ps;
            assert(ps[0] != '0');
            for (char c : ps) z[c-'0'] = 1;
            for (int i = 0; i < 10; ++i) {
                assert(z[i] == ds[i]);
            }
        } else {
            assert(ans == "NO");
            cout << __builtin_popcount(i) << ": ";
            for (int i = 0; i < 10; ++i) if (ds[i]) cout << i << " ";
            cout << endl;
        }
    }
    cerr << "ok" << endl;
}

Test details

Test 1

Group: 1, 2, 3

Verdict:

input
10
1
0
1
1
...

correct output
NO
YES
11
YES
2
...

user output
(empty)

Error:
code: input/code.cpp:30: int main(): Assertion `ans == "NO"' failed.

Test 2

Group: 2, 3

Verdict:

input
175
1
0
1
1
...

correct output
NO
YES
11
YES
2
...

user output
(empty)

Error:
code: input/code.cpp:30: int main(): Assertion `ans == "NO"' failed.

Test 3

Group: 3

Verdict:

input
848
4
0 1 2 3
4
0 1 2 4
...

correct output
YES
10223
YES
4021
YES
...

user output
(empty)

Error:
code: input/code.cpp:30: int main(): Assertion `ans == "NO"' failed.