213122026-01-12 18:20:01algoproJárda-L (40)pypy3Wrong answer 2/4046ms19616 KiB
# UUID: 7a0b8b44-aa11-408d-bfc1-eb55d6891415
n = int(input())
a = [0] * (n+1)
b = [0] * (n+1)

a[0] = 1
a[1] = 1
b[0] = 0
b[1] = 0

for i in range(2, n):
    a[i] = a[i-1] + a[i-2] + 2*b[i-1]
    b[i] = a[i-2] + b[i-1]

print(sum(a) + sum(b))




























SubtaskSumTestVerdictTimeMemory
base2/40
1Accepted0/039ms19616 KiB
2Wrong answer0/045ms19360 KiB
3Wrong answer0/243ms19616 KiB
4Accepted2/239ms19400 KiB
5Wrong answer0/243ms19360 KiB
6Wrong answer0/243ms19444 KiB
7Wrong answer0/239ms19388 KiB
8Wrong answer0/337ms19380 KiB
9Wrong answer0/343ms19424 KiB
10Wrong answer0/339ms19596 KiB
11Wrong answer0/339ms19428 KiB
12Wrong answer0/343ms19432 KiB
13Wrong answer0/346ms19328 KiB
14Wrong answer0/343ms19292 KiB
15Wrong answer0/339ms19440 KiB
16Wrong answer0/337ms19356 KiB
17Wrong answer0/343ms19448 KiB