Task: | Conspiracies everywhere |
Sender: | ht |
Submission time: | 2024-11-16 15:57:10 +0200 |
Language: | Python3 (PyPy3) |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.04 s | details |
#2 | ACCEPTED | 0.04 s | details |
#3 | WRONG ANSWER | 0.04 s | details |
#4 | WRONG ANSWER | 0.04 s | details |
#5 | ACCEPTED | 0.04 s | details |
#6 | WRONG ANSWER | 0.04 s | details |
#7 | ACCEPTED | 0.04 s | details |
#8 | ACCEPTED | 0.04 s | details |
#9 | ACCEPTED | 0.04 s | details |
#10 | ACCEPTED | 0.04 s | details |
#11 | ACCEPTED | 0.04 s | details |
#12 | ACCEPTED | 0.04 s | details |
#13 | ACCEPTED | 0.04 s | details |
#14 | ACCEPTED | 0.04 s | details |
#15 | ACCEPTED | 0.04 s | details |
#16 | WRONG ANSWER | 0.04 s | details |
Code
n,q = [int(x) for x in input().split(" ")] def test(row): xs = [int(x) for x in row.split(" ")] # print(xs) while len(xs) > 1: xs = [a+b for a,b in zip(xs[:-1], xs[1:])] # print(xs) # print(xs[0], n, xs[0] == q) return q - xs[0] def eqnum(k): if k % 2 == 1: return k*((k+1)//2) else: return (k//2)*(k+1) if q < n: print("The truth is out there") elif n == 1: res = str(q) test(res) elif n == 2: res = (f"1 {q-1}") test(res) print(res) elif n == 3: if q - 3 <= 0: print("The truth is out there") else: res = (f"1 1 {q - 3}") test(res) print(res) else: b = q - 2 * eqnum(n-1) - 2 ** (n-1) + 1 if b <= 0: print("The truth is out there") else: res = f"1 " * (n - 1) diff = test(res + f"{b}") res += f"{b+diff}" test(res) print(res)
Test details
Test 1
Verdict: ACCEPTED
input |
---|
3 8 |
correct output |
---|
5 1 1 |
user output |
---|
1 1 5 |
Test 2
Verdict: ACCEPTED
input |
---|
2 1 |
correct output |
---|
The truth is out there |
user output |
---|
The truth is out there |
Test 3
Verdict: WRONG ANSWER
input |
---|
1 1000000000000000000 |
correct output |
---|
1000000000000000000 |
user output |
---|
(empty) |
Test 4
Verdict: WRONG ANSWER
input |
---|
1 1 |
correct output |
---|
1 |
user output |
---|
(empty) |
Test 5
Verdict: ACCEPTED
input |
---|
60 1000000000000000000 |
correct output |
---|
423539247696576513 1 1 1 1 1 1... |
user output |
---|
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... |
Test 6
Verdict: WRONG ANSWER
input |
---|
10 512 |
correct output |
---|
1 1 1 1 1 1 1 1 1 1 |
user output |
---|
The truth is out there |
Test 7
Verdict: ACCEPTED
input |
---|
60 500000000000000000 |
correct output |
---|
The truth is out there |
user output |
---|
The truth is out there |
Test 8
Verdict: ACCEPTED
input |
---|
5 1000000000 |
correct output |
---|
999999985 1 1 1 1 |
user output |
---|
1 1 1 1 999999985 |
Test 9
Verdict: ACCEPTED
input |
---|
19 1000000000 |
correct output |
---|
999737857 1 1 1 1 1 1 1 1 1 1 ... |
user output |
---|
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... |
Test 10
Verdict: ACCEPTED
input |
---|
59 1000000000000000000 |
correct output |
---|
711769623848288257 1 1 1 1 1 1... |
user output |
---|
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... |
Test 11
Verdict: ACCEPTED
input |
---|
42 133713371337 |
correct output |
---|
The truth is out there |
user output |
---|
The truth is out there |
Test 12
Verdict: ACCEPTED
input |
---|
42 1337133713371337 |
correct output |
---|
1334934690115786 1 1 1 1 1 1 1... |
user output |
---|
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... |
Test 13
Verdict: ACCEPTED
input |
---|
2 2 |
correct output |
---|
1 1 |
user output |
---|
1 1 |
Test 14
Verdict: ACCEPTED
input |
---|
2 1000000000000000000 |
correct output |
---|
999999999999999999 1 |
user output |
---|
1 999999999999999999 |
Test 15
Verdict: ACCEPTED
input |
---|
10 511 |
correct output |
---|
The truth is out there |
user output |
---|
The truth is out there |
Test 16
Verdict: WRONG ANSWER
input |
---|
10 513 |
correct output |
---|
2 1 1 1 1 1 1 1 1 1 |
user output |
---|
The truth is out there |