137322025-01-08 15:27:53birozsJárda-L (40)python3Accepted 40/4018ms3204 KiB
N = int(input())
def sorozat(n):
    if n == 1:
        return 1
    elif n == 2:
        return 2
    elif n == 3:
        return 5
    else:
        return 2*sorozat(n-1) + sorozat(n-3)
print(sorozat(N))
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/014ms2868 KiB
2Accepted0/017ms2868 KiB
3Accepted2/214ms2868 KiB
4Accepted2/216ms2868 KiB
5Accepted2/216ms3016 KiB
6Accepted2/214ms2868 KiB
7Accepted2/216ms3204 KiB
8Accepted3/314ms2868 KiB
9Accepted3/316ms2932 KiB
10Accepted3/316ms3004 KiB
11Accepted3/316ms3016 KiB
12Accepted3/314ms3000 KiB
13Accepted3/317ms2868 KiB
14Accepted3/317ms3072 KiB
15Accepted3/317ms3012 KiB
16Accepted3/318ms3064 KiB
17Accepted3/314ms2972 KiB