Task: | Summat |
Sender: | rasastusni |
Submission time: | 2020-09-27 01:32:11 +0300 |
Language: | C++ (C++17) |
Status: | READY |
Result: | 12 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 12 |
#2 | RUNTIME ERROR | 0 |
#3 | RUNTIME ERROR | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#2 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#3 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#4 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#5 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#6 | RUNTIME ERROR | 0.01 s | 2, 3 | details |
#7 | RUNTIME ERROR | 0.01 s | 2, 3 | details |
#8 | RUNTIME ERROR | 0.01 s | 2, 3 | details |
#9 | RUNTIME ERROR | 0.01 s | 2, 3 | details |
#10 | RUNTIME ERROR | 0.01 s | 2, 3 | details |
#11 | RUNTIME ERROR | 0.01 s | 3 | details |
#12 | RUNTIME ERROR | 0.01 s | 3 | details |
#13 | RUNTIME ERROR | 0.01 s | 3 | details |
#14 | RUNTIME ERROR | 0.01 s | 3 | details |
#15 | RUNTIME ERROR | 0.01 s | 3 | details |
Code
#include <algorithm> #include <iostream> using namespace std; int n; int bs[100]; int seq[100]; void find(int depth) { if (depth == n) { int asd[100]; int c = 0; for (int i = 0; i < n; ++i) { for (int a = i + 1; a < n; ++a) { asd[c++] = seq[i] + seq[a]; } } sort(asd, asd + c); if (equal(asd, asd+c, bs)) { for (int i = 0; i < n - 1; ++i) { cout << seq[i] << " "; } cout << seq[n-1] << endl; exit(0); } return; } for (int i = 1; i <= 5; ++i) { seq[depth] = i; find(depth + 1); } } int main() { cin >> n; if (n < 3 || n > 5) { return -1; } for (int i = 0; i < n*(n-1)/2; ++i) { cin >> bs[i]; } sort(bs, bs + n*(n-1)/2); find(0); }
Test details
Test 1
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
5 2 2 2 2 2 2 2 2 2 2 |
correct output |
---|
1 1 1 1 1 |
user output |
---|
1 1 1 1 1 |
Test 2
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
5 3 4 5 5 6 6 7 7 8 9 |
correct output |
---|
1 2 3 4 5 |
user output |
---|
1 2 3 4 5 |
Test 3
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
5 5 6 6 6 9 9 9 10 10 10 |
correct output |
---|
1 4 5 5 5 |
user output |
---|
1 4 5 5 5 |
Test 4
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
5 2 3 3 6 6 6 6 7 7 10 |
correct output |
---|
1 1 2 5 5 |
user output |
---|
1 1 2 5 5 |
Test 5
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
5 4 5 5 5 5 6 6 6 7 7 |
correct output |
---|
2 2 3 3 4 |
user output |
---|
2 2 3 3 4 |
Test 6
Group: 2, 3
Verdict: RUNTIME ERROR
input |
---|
20 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ... |
correct output |
---|
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... |
user output |
---|
(empty) |
Test 7
Group: 2, 3
Verdict: RUNTIME ERROR
input |
---|
20 3 4 5 5 6 6 7 7 7 8 8 8 9 9 9 ... |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
(empty) |
Test 8
Group: 2, 3
Verdict: RUNTIME ERROR
input |
---|
20 52 55 55 57 62 62 63 64 66 71 ... |
correct output |
---|
1 51 54 54 56 61 61 62 63 65 7... |
user output |
---|
(empty) |
Test 9
Group: 2, 3
Verdict: RUNTIME ERROR
input |
---|
20 25 30 31 32 36 39 40 41 45 45 ... |
correct output |
---|
8 17 22 23 24 28 43 50 53 55 6... |
user output |
---|
(empty) |
Test 10
Group: 2, 3
Verdict: RUNTIME ERROR
input |
---|
20 9 10 14 17 17 20 21 22 24 25 2... |
correct output |
---|
1 8 9 13 16 19 30 32 38 40 43 ... |
user output |
---|
(empty) |
Test 11
Group: 3
Verdict: RUNTIME ERROR
input |
---|
100 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ... |
correct output |
---|
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... |
user output |
---|
(empty) |
Test 12
Group: 3
Verdict: RUNTIME ERROR
input |
---|
100 3 4 5 5 6 6 7 7 7 8 8 8 9 9 9 ... |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
(empty) |
Test 13
Group: 3
Verdict: RUNTIME ERROR
input |
---|
100 502824619 505239810 505668108 ... |
correct output |
---|
1 502824618 505239809 50566810... |
user output |
---|
(empty) |
Test 14
Group: 3
Verdict: RUNTIME ERROR
input |
---|
100 17871832 41618648 51611938 538... |
correct output |
---|
3939271 13932561 37679377 4989... |
user output |
---|
(empty) |
Test 15
Group: 3
Verdict: RUNTIME ERROR
input |
---|
100 70588435 115481965 116040218 1... |
correct output |
---|
5902586 64685849 109579379 110... |
user output |
---|
(empty) |