Task: | Summat |
Sender: | Mahtimursu |
Submission time: | 2020-09-26 12:32:45 +0300 |
Language: | C++ (C++11) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
#3 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
#2 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
#3 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
#4 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
#5 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
#6 | WRONG ANSWER | 0.01 s | 2, 3 | details |
#7 | WRONG ANSWER | 0.01 s | 2, 3 | details |
#8 | WRONG ANSWER | 0.01 s | 2, 3 | details |
#9 | WRONG ANSWER | 0.01 s | 2, 3 | details |
#10 | WRONG ANSWER | 0.01 s | 2, 3 | details |
#11 | WRONG ANSWER | 0.01 s | 3 | details |
#12 | WRONG ANSWER | 0.01 s | 3 | details |
#13 | WRONG ANSWER | 0.01 s | 3 | details |
#14 | WRONG ANSWER | 0.01 s | 3 | details |
#15 | WRONG ANSWER | 0.01 s | 3 | details |
Code
#include <bits/stdc++.h> typedef long long ll; #define M 1000000007 using namespace std; void s() { int a, b, c; cin >> a >> b >> c; int bcd = b - a; int acd = c - a; //cout << bcd << " " << acd << endl; for (int i = 1; i < c + a + b; ++i) { int nc = i + acd; int nb = nc - bcd; //cout << i << " " << nb << " " << nc << endl; if (i + nb == a && i + nc == b && nc + nb == c) { cout << i << " " << nb << " " << nc << endl; return; } } } int main() { ios_base::sync_with_stdio(false); cin.tie(0); int n; cin >> n; if (n == 3) { s(); return 0; } int b = n * (n - 1) / 2; vector<int> v(b); vector<int> g(n); for (int i = 0; i < b; ++i) { cin >> v[i]; } // Lasketaan kuinka paljon suurempi luku on kuin v[1] g[0] = v[1] - v[n - 1]; for (int i = 1; i <= n; ++i) { g[i] = v[i-1] - v[0]; } for (auto val : g) { cout << val << " "; } cout << endl; for (int i = 1; i < 200; ++i) { // Kokeillaan onko i toinen luku: bool ok = true; for (int l = 0; l < n - 1; ++l) { if (!ok) break; for (int r = l + 1; r < n; ++r) { int gi = l * n + r; int lv = i + g[l]; int rv = i + g[r]; if (lv > 0 && rv > 0 && lv + rv == v[gi-1]) { ok = false; break; } } } if (!ok) { for (int val : g) { cout << i + val << " "; } cout << endl; return 0; } } return 0; }
Test details
Test 1
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
5 2 2 2 2 2 2 2 2 2 2 |
correct output |
---|
1 1 1 1 1 |
user output |
---|
0 0 0 0 0 1 1 1 1 1 |
Test 2
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
5 3 4 5 5 6 6 7 7 8 9 |
correct output |
---|
1 2 3 4 5 |
user output |
---|
-2 0 1 2 2 1 3 4 5 5 |
Test 3
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
5 5 6 6 6 9 9 9 10 10 10 |
correct output |
---|
1 4 5 5 5 |
user output |
---|
-3 0 1 1 1 1 4 5 5 5 |
Test 4
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
5 2 3 3 6 6 6 6 7 7 10 |
correct output |
---|
1 1 2 5 5 |
user output |
---|
-3 0 1 1 4 0 3 4 4 7 |
Test 5
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
5 4 5 5 5 5 6 6 6 7 7 |
correct output |
---|
2 2 3 3 4 |
user output |
---|
0 0 1 1 1 2 2 3 3 3 |
Test 6
Group: 2, 3
Verdict: WRONG ANSWER
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 |
---|
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... |
Test 7
Group: 2, 3
Verdict: WRONG ANSWER
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 |
---|
-6 0 1 2 2 3 3 4 4 4 5 5 5 6 6... Truncated |
Test 8
Group: 2, 3
Verdict: WRONG ANSWER
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 |
---|
-50 0 3 3 5 10 10 11 12 14 19 ... Truncated |
Test 9
Group: 2, 3
Verdict: WRONG ANSWER
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 |
---|
-33 0 5 6 7 11 14 15 16 20 20 ... Truncated |
Test 10
Group: 2, 3
Verdict: WRONG ANSWER
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 |
---|
-29 0 1 5 8 8 11 12 13 15 16 1... Truncated |
Test 11
Group: 3
Verdict: WRONG ANSWER
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 |
---|
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... Truncated |
Test 12
Group: 3
Verdict: WRONG ANSWER
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 |
---|
-17 0 1 2 2 3 3 4 4 4 5 5 5 6 ... Truncated |
Test 13
Group: 3
Verdict: WRONG ANSWER
input |
---|
100 502824619 505239810 505668108 ... |
correct output |
---|
1 502824618 505239809 50566810... |
user output |
---|
-502824617 0 2415191 2843489 5... Truncated |
Test 14
Group: 3
Verdict: WRONG ANSWER
input |
---|
100 17871832 41618648 51611938 538... |
correct output |
---|
3939271 13932561 37679377 4989... |
user output |
---|
-194412780 0 23746816 33740106... Truncated |
Test 15
Group: 3
Verdict: WRONG ANSWER
input |
---|
100 70588435 115481965 116040218 1... |
correct output |
---|
5902586 64685849 109579379 110... |
user output |
---|
-181705990 0 44893530 45451783... Truncated |