Task: | Patuljci |
Sender: | henrikaalto |
Submission time: | 2019-07-24 14:03:10 +0300 |
Language: | C++ (C++17) |
Status: | READY |
Result: | 100 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 100 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.01 s | details |
#2 | ACCEPTED | 0.01 s | details |
#3 | ACCEPTED | 0.01 s | details |
#4 | ACCEPTED | 0.01 s | details |
#5 | ACCEPTED | 0.01 s | details |
#6 | ACCEPTED | 0.01 s | details |
#7 | ACCEPTED | 0.01 s | details |
#8 | ACCEPTED | 0.01 s | details |
#9 | ACCEPTED | 0.01 s | details |
#10 | ACCEPTED | 0.01 s | details |
Code
#include <bits/stdc++.h> using namespace std; int main() { const int N = 9; vector<int> v(N); for (int i = 0; i < N; ++i) { cin >> v[i]; } for (int j = 0; j < (1 << N); ++j) { int s = 0; int o = 0; for (int i = 0; i < N; ++i) { if (j & (1 << i)) { s += v[i]; o++; } } if (o != 7) continue; if (s != 100) continue; for (int i = 0; i < N; ++i) { if (j & (1 << i)) { cout << v[i] << "\n"; } } return 0; } }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
1
5 6 7 10 ... |
correct output |
---|
1
5 6 7 19 ... |
user output |
---|
1 5 6 7 19 ... |
Test 2
Verdict: ACCEPTED
input |
---|
1
2 3 4 5 ... |
correct output |
---|
1
2 3 4 5 ... |
user output |
---|
1 2 3 4 5 ... |
Test 3
Verdict: ACCEPTED
input |
---|
99
98 11 12 13 ... |
correct output |
---|
11
12 13 14 15 ... |
user output |
---|
11 12 13 14 15 ... |
Test 4
Verdict: ACCEPTED
input |
---|
25
23 11 2 18 ... |
correct output |
---|
23
11 2 18 3 ... |
user output |
---|
23 11 2 18 3 ... |
Test 5
Verdict: ACCEPTED
input |
---|
15
12 22 28 18 ... |
correct output |
---|
15
22 28 18 3 ... |
user output |
---|
15 22 28 18 3 ... |
Test 6
Verdict: ACCEPTED
input |
---|
19
16 32 4 17 ... |
correct output |
---|
19
16 32 4 23 ... |
user output |
---|
19 16 32 4 23 ... |
Test 7
Verdict: ACCEPTED
input |
---|
3
37 5 36 6 ... |
correct output |
---|
3
37 5 6 19 ... |
user output |
---|
3 37 5 6 19 ... |
Test 8
Verdict: ACCEPTED
input |
---|
13
17 6 10 19 ... |
correct output |
---|
13
17 6 19 8 ... |
user output |
---|
13 17 6 19 8 ... |
Test 9
Verdict: ACCEPTED
input |
---|
19
15 4 9 16 ... |
correct output |
---|
19
4 9 16 33 ... |
user output |
---|
19 4 9 16 33 ... |
Test 10
Verdict: ACCEPTED
input |
---|
32
14 18 8 38 ... |
correct output |
---|
32
8 38 1 2 ... |
user output |
---|
32 8 38 1 2 ... |