94262024-02-21 16:13:34Tina0731Járda-L (40)cpp17Wrong answer 8/403ms3608 KiB
#include <iostream>

using namespace std;

int main()
{
    int a[29];
    int b[29];
    a[1]=1;
    a[2]=2;
    a[3]=5;

    b[1]=0;
    b[2]=2;
    b[3]=2;

    for(int i=4;i<29;i++)
    {
        b[i]=a[i-2]+b[i-2];
        a[i]=a[i-1]+a[i-2]+2*b[i-1];
    }
    int n;
    cin>>n;
    cout<<a[n];

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base8/40
1Accepted0/03ms1744 KiB
2Wrong answer0/03ms1912 KiB
3Accepted2/23ms2164 KiB
4Accepted2/23ms2400 KiB
5Accepted2/23ms2588 KiB
6Accepted2/23ms2640 KiB
7Wrong answer0/23ms2612 KiB
8Wrong answer0/33ms2736 KiB
9Wrong answer0/33ms2856 KiB
10Wrong answer0/33ms2856 KiB
11Wrong answer0/33ms2856 KiB
12Wrong answer0/33ms2952 KiB
13Wrong answer0/33ms3072 KiB
14Wrong answer0/33ms3196 KiB
15Wrong answer0/33ms3440 KiB
16Wrong answer0/33ms3488 KiB
17Wrong answer0/33ms3608 KiB