222382026-01-14 18:23:13algoproJárda-L (40)pypy3Wrong answer 8/4046ms19572 KiB
# UUID: 86253f8f-5b0d-4d39-a773-9d90dae77de8
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-1] - a[i-2])*2 + a[i-4] + 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
base8/40
1Accepted0/043ms19572 KiB
2Wrong answer0/039ms19424 KiB
3Accepted2/239ms19368 KiB
4Accepted2/245ms19404 KiB
5Accepted2/243ms19432 KiB
6Accepted2/239ms19420 KiB
7Wrong answer0/237ms19436 KiB
8Wrong answer0/343ms19440 KiB
9Wrong answer0/339ms19432 KiB
10Wrong answer0/339ms19420 KiB
11Wrong answer0/343ms19352 KiB
12Wrong answer0/343ms19436 KiB
13Wrong answer0/345ms19496 KiB
14Wrong answer0/343ms19348 KiB
15Wrong answer0/339ms19528 KiB
16Wrong answer0/337ms19520 KiB
17Wrong answer0/346ms19552 KiB