Submission details
Task:Jubilee
Sender:Works on my Machine
Submission time:2025-11-08 14:27:44 +0200
Language:Python3 (PyPy3)
Status:READY
Result:
Test results
testverdicttime
#10.04 sdetails
#20.04 sdetails
#30.04 sdetails
#40.04 sdetails
#50.04 sdetails
#6--details
#70.04 sdetails
#80.30 sdetails
#90.04 sdetails
#100.30 sdetails
#11--details
#120.04 sdetails
#13--details
#14--details

Code

v = input().split()

n = int(v[0])

m = int(v[1])

DP = [[0]*n, [0]*n]

print(DP)

DP[0][0] = m
DP[1][0] = m-1

for i in range(1, n):
    DP[0][i] = DP[0][i-1]*DP[1][i-1]*(m-1)
    DP[1][i] = DP[1][i-1]*DP[1][i-1]*(m-1)


print(DP[1][n-1])

Test details

Test 1

Verdict:

input
3 2

correct output
2

user output
[[0, 0, 0], [0, 0, 0]]
1

Feedback: Output is longer than expected

Test 2

Verdict:

input
1 1

correct output
0

user output
[[0], [0]]
0

Feedback: Output is longer than expected

Test 3

Verdict:

input
1 1000000000

correct output
56

user output
[[0], [0]]
999999999

Feedback: Output is longer than expected

Test 4

Verdict:

input
2 1000000000

correct output
4088

user output
[[0, 0], [0, 0]]
999999997000000002999999999

Feedback: Output is longer than expected

Test 5

Verdict:

input
3 1000000000

correct output
298424

user output
[[0, 0, 0], [0, 0, 0]]
999999993000000020999999965000...

Feedback: Output is longer than expected

Test 6

Verdict:

input
1000000 1000000000

correct output
859388820

user output
(empty)

Test 7

Verdict:

input
2 1

correct output
0

user output
[[0, 0], [0, 0]]
0

Feedback: Output is longer than expected

Test 8

Verdict:

input
1000000 1

correct output
0

user output
[[0, 0, 0, 0, 0, 0, 0, 0, 0, 0...

Feedback: Output is longer than expected

Test 9

Verdict:

input
1 2

correct output
2

user output
[[0], [0]]
1

Feedback: Output is longer than expected

Test 10

Verdict:

input
1000000 2

correct output
2

user output
[[0, 0, 0, 0, 0, 0, 0, 0, 0, 0...

Feedback: Output is longer than expected

Test 11

Verdict:

input
1000000 3

correct output
129870828

user output
(empty)

Test 12

Verdict:

input
1 3

correct output
6

user output
[[0], [0]]
2

Feedback: Output is longer than expected

Test 13

Verdict:

input
21355 1239478

correct output
74219157

user output
(empty)

Test 14

Verdict:

input
531578 913517291

correct output
105420893

user output
(empty)