222372026-01-14 18:22:27algoproJárda-L (40)pypy3Wrong answer 6/4045ms19648 KiB
# UUID: b256f789-af46-4259-9d5e-88454e7a8833
n = int(input())
a = [0]*28 
a[0] = 1
a[1] = 2
a[2] = 5
a[3] = 11
if n > 4:
    for i in range(4, n):
        a[i] = (a[i-1] - a[i-2])*2 + a[i-3] + a[i-1]
    print(a[n-1])
else:
    print(a[n-1])









# 1 = 1, 2 = 2, 3 = 5, 4 = 11, 5 = 24, 6 = 53,
#     1      3      6      13      29
SubtaskSumTestVerdictTimeMemory
base6/40
1Accepted0/043ms19436 KiB
2Wrong answer0/039ms19436 KiB
3Accepted2/239ms19296 KiB
4Accepted2/239ms19512 KiB
5Accepted2/239ms19436 KiB
6Wrong answer0/239ms19432 KiB
7Wrong answer0/245ms19436 KiB
8Wrong answer0/343ms19444 KiB
9Wrong answer0/339ms19436 KiB
10Wrong answer0/345ms19432 KiB
11Wrong answer0/345ms19324 KiB
12Wrong answer0/339ms19488 KiB
13Wrong answer0/343ms19504 KiB
14Wrong answer0/339ms19372 KiB
15Wrong answer0/337ms19648 KiB
16Wrong answer0/343ms19484 KiB
17Wrong answer0/337ms19332 KiB