123262024-12-12 13:05:11birozsJárda-L (40)python3Accepted 40/4019ms3180 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/016ms2864 KiB
2Accepted0/017ms2872 KiB
3Accepted2/216ms2868 KiB
4Accepted2/216ms2872 KiB
5Accepted2/216ms3024 KiB
6Accepted2/216ms3080 KiB
7Accepted2/216ms3076 KiB
8Accepted3/314ms2972 KiB
9Accepted3/316ms2880 KiB
10Accepted3/316ms2868 KiB
11Accepted3/316ms3008 KiB
12Accepted3/316ms2868 KiB
13Accepted3/317ms2872 KiB
14Accepted3/317ms3180 KiB
15Accepted3/317ms2872 KiB
16Accepted3/319ms2872 KiB
17Accepted3/316ms2996 KiB