137352025-01-08 15:39:55birozsJárda-L (40)python3Accepted 40/4016ms3128 KiB
N = int(input())
lista = [0,1,2,5]
if N <= 3:
    print(lista[N])
else:
    for i in range(4,N+1):
        lista.append(2*lista[i-1]+lista[i-3])
    print(lista[N])
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/016ms2880 KiB
2Accepted0/016ms3056 KiB
3Accepted2/216ms2864 KiB
4Accepted2/214ms2868 KiB
5Accepted2/216ms3064 KiB
6Accepted2/214ms2860 KiB
7Accepted2/216ms2872 KiB
8Accepted3/316ms3060 KiB
9Accepted3/316ms3064 KiB
10Accepted3/316ms2864 KiB
11Accepted3/316ms2872 KiB
12Accepted3/316ms3068 KiB
13Accepted3/314ms3128 KiB
14Accepted3/316ms2876 KiB
15Accepted3/316ms2868 KiB
16Accepted3/314ms3112 KiB
17Accepted3/316ms2876 KiB