CSES - HIIT Open 2024 - Results
Submission details
Task:Conspiracies everywhere
Sender:ht
Submission time:2024-11-16 15:38:23 +0200
Language:Python3 (PyPy3)
Status:READY
Result:
Test results
testverdicttime
#1ACCEPTED0.04 sdetails
#2ACCEPTED0.04 sdetails
#3ACCEPTED0.04 sdetails
#4ACCEPTED0.04 sdetails
#50.04 sdetails
#60.04 sdetails
#7ACCEPTED0.04 sdetails
#80.04 sdetails
#90.04 sdetails
#100.04 sdetails
#11ACCEPTED0.04 sdetails
#120.04 sdetails
#13ACCEPTED0.04 sdetails
#14ACCEPTED0.04 sdetails
#15ACCEPTED0.04 sdetails
#160.04 sdetails

Code

n,q = [int(x) for x in input().split(" ")]
if q < n:
    print("The truth is out there")
elif n == 1:
    print(q)
elif n == 2:
    print(f"1 {q-1}")
elif n == 3:
    print(f"1 1 {q - 3}")
else:
    lm = 2 ** (n-2)
    if q % 2 == 0:
        b = q - 2 ** (n-1) - lm * (lm-1) // 2 + 1
        if b < 1:
            print("The truth is out there")
        else:
            print(str(b)+ (' 1' * (n-1)))
    else:
        c = lm * 2 + 1
        b = q - 2 ** (n-1) - lm * (lm-1) // 2 + 1 - c
        if b < 1:
            print("The truth is out there")
        else:
            print(str(b)+ (' 1' * (n-2)) + " 2")

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: ACCEPTED

input
1 1000000000000000000

correct output
1000000000000000000

user output
1000000000000000000

Test 4

Verdict: ACCEPTED

input
1 1

correct output
1

user output
1

Test 5

Verdict:

input
60 1000000000000000000

correct output
423539247696576513 1 1 1 1 1 1...

user output
The truth is out there

Test 6

Verdict:

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:

input
5 1000000000

correct output
999999985 1 1 1 1

user output
999999957 1 1 1 1

Test 9

Verdict:

input
19 1000000000

correct output
999737857 1 1 1 1 1 1 1 1 1 1 ...

user output
The truth is out there

Test 10

Verdict:

input
59 1000000000000000000

correct output
711769623848288257 1 1 1 1 1 1...

user output
The truth is out there

Test 11

Verdict: ACCEPTED

input
42 133713371337

correct output
The truth is out there

user output
The truth is out there

Test 12

Verdict:

input
42 1337133713371337

correct output
1334934690115786 1 1 1 1 1 1 1...

user output
The truth is out there

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:

input
10 513

correct output
2 1 1 1 1 1 1 1 1 1

user output
The truth is out there