97292024-03-04 15:19:25TimiJárda-L (40)cpp17Wrong answer 4/403ms3564 KiB
#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int d[n+1];
    d[1]=1;
    d[2]=2;
    d[3]=5;
    for (int i=4; i<=n; i++)
        d[i]=d[i-1]+d[i-2]+2*d[i-3];

    cout<<d[n]<<endl;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base4/40
1Accepted0/03ms1904 KiB
2Wrong answer0/03ms2140 KiB
3Accepted2/22ms2128 KiB
4Accepted2/23ms2368 KiB
5Wrong answer0/23ms2612 KiB
6Wrong answer0/23ms2724 KiB
7Wrong answer0/23ms2788 KiB
8Wrong answer0/32ms2864 KiB
9Wrong answer0/33ms2952 KiB
10Wrong answer0/32ms3040 KiB
11Wrong answer0/33ms3048 KiB
12Wrong answer0/33ms3196 KiB
13Wrong answer0/33ms3312 KiB
14Wrong answer0/33ms3564 KiB
15Wrong answer0/33ms3532 KiB
16Wrong answer0/32ms3532 KiB
17Wrong answer0/32ms3532 KiB