Task: | Alkuluvut |
Sender: | ollpu |
Submission time: | 2025-09-26 22:51:36 +0300 |
Language: | C++ (C++20) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | RUNTIME ERROR | 0 |
#2 | RUNTIME ERROR | 0 |
#3 | RUNTIME ERROR | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | RUNTIME ERROR | 0.00 s | 1, 2, 3 | details |
#2 | RUNTIME ERROR | 0.00 s | 2, 3 | details |
#3 | RUNTIME ERROR | 0.00 s | 3 | details |
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: RUNTIME ERROR
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: RUNTIME ERROR
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: RUNTIME ERROR
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.