15632022-11-25 11:56:52DragonoidOmegaJárda-L (40)cpp11Accepted 40/403ms3812 KiB
#include <iostream>

using namespace std;

int x[101],f[101];
int i,n;
int main()
{
    x[1]=1;
    x[2]=2;
    f[2]=2;


    cin>>n;


    for(i=3;i<=n;++i)
    {
        x[i]=x[i-1]+x[i-2]+f[i-1];
        f[i]=x[i-2]+f[i-1]+x[i-2];

    }

    cout<<x[n];
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/03ms1872 KiB
2Accepted0/02ms2400 KiB
3Accepted2/22ms2344 KiB
4Accepted2/22ms2548 KiB
5Accepted2/22ms2744 KiB
6Accepted2/22ms2804 KiB
7Accepted2/22ms2956 KiB
8Accepted3/32ms3160 KiB
9Accepted3/32ms3164 KiB
10Accepted3/32ms3160 KiB
11Accepted3/32ms3288 KiB
12Accepted3/32ms3496 KiB
13Accepted3/32ms3576 KiB
14Accepted3/32ms3568 KiB
15Accepted3/32ms3568 KiB
16Accepted3/32ms3700 KiB
17Accepted3/32ms3812 KiB