123582024-12-13 10:34:06SunDisznoJárda-L (40)python3Accepted 40/4018ms3280 KiB
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(int(input())))
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/016ms2876 KiB
2Accepted0/017ms2868 KiB
3Accepted2/216ms2872 KiB
4Accepted2/216ms2860 KiB
5Accepted2/216ms2872 KiB
6Accepted2/216ms3064 KiB
7Accepted2/216ms2872 KiB
8Accepted3/317ms3280 KiB
9Accepted3/316ms2872 KiB
10Accepted3/316ms2884 KiB
11Accepted3/316ms2852 KiB
12Accepted3/316ms2980 KiB
13Accepted3/317ms3268 KiB
14Accepted3/317ms3064 KiB
15Accepted3/317ms2872 KiB
16Accepted3/318ms2868 KiB
17Accepted3/316ms2872 KiB