94252024-02-21 16:12:42Tina0731Járda-L (40)cpp17Wrong answer 6/403ms3708 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]=2*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
base6/40
1Accepted0/03ms1872 KiB
2Wrong answer0/03ms2000 KiB
3Accepted2/23ms2220 KiB
4Accepted2/23ms2440 KiB
5Accepted2/23ms2864 KiB
6Wrong answer0/23ms2896 KiB
7Wrong answer0/23ms3108 KiB
8Wrong answer0/33ms3296 KiB
9Wrong answer0/33ms3516 KiB
10Wrong answer0/33ms3532 KiB
11Wrong answer0/33ms3536 KiB
12Wrong answer0/33ms3544 KiB
13Wrong answer0/33ms3548 KiB
14Wrong answer0/33ms3548 KiB
15Wrong answer0/33ms3680 KiB
16Wrong answer0/33ms3704 KiB
17Wrong answer0/33ms3708 KiB