124942024-12-19 11:27:51nkbalintJárda-L (40)cpp17Wrong answer 4/401ms508 KiB
#include <iostream>

using namespace std;

int n,v[29],i;

int main()
{
    cin>>n;
    v[1]=1;
    v[2]=2;
    v[3]=5;
    v[4]=8;
    v[5]=18;
    if(n>5)
    {
        for(i=1;i<=n;++i)
        {
            v[i]=2*v[i-2]+2*v[i-4]+6*(i-4);
        }
    }
    cout<<v[n];
}
SubtaskSumTestVerdictTimeMemory
base4/40
1Accepted0/01ms508 KiB
2Wrong answer0/01ms508 KiB
3Accepted2/21ms320 KiB
4Accepted2/21ms508 KiB
5Wrong answer0/21ms320 KiB
6Wrong answer0/21ms508 KiB
7Wrong answer0/21ms320 KiB
8Wrong answer0/31ms508 KiB
9Wrong answer0/31ms320 KiB
10Wrong answer0/31ms500 KiB
11Wrong answer0/31ms320 KiB
12Wrong answer0/31ms320 KiB
13Wrong answer0/31ms320 KiB
14Wrong answer0/31ms396 KiB
15Wrong answer0/31ms320 KiB
16Wrong answer0/31ms332 KiB
17Wrong answer0/31ms320 KiB