222352026-01-14 18:21:10algoproJárda-L (40)pypy3Wrong answer 6/4045ms19680 KiB
# UUID: 554791c3-33b0-4534-9fa0-b280555ad4e1
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] - a[i-1])*2 + a[i-2] + 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/043ms19360 KiB
2Wrong answer0/039ms19308 KiB
3Accepted2/239ms19448 KiB
4Accepted2/237ms19512 KiB
5Accepted2/245ms19308 KiB
6Wrong answer0/243ms19440 KiB
7Wrong answer0/245ms19376 KiB
8Wrong answer0/339ms19392 KiB
9Wrong answer0/343ms19288 KiB
10Wrong answer0/339ms19424 KiB
11Wrong answer0/343ms19412 KiB
12Wrong answer0/339ms19496 KiB
13Wrong answer0/339ms19436 KiB
14Wrong answer0/337ms19680 KiB
15Wrong answer0/343ms19496 KiB
16Wrong answer0/339ms19492 KiB
17Wrong answer0/343ms19436 KiB