124912024-12-19 11:25:42nkbalintJárda-L (40)cpp17Wrong answer 0/401ms588 KiB
#include <iostream>

using namespace std;

int n,v[29],i;

int main()
{
    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[n-2]+2*v[i-4]+6*i-4;
        }
    }
    cout<<v[n];
}
SubtaskSumTestVerdictTimeMemory
base0/40
1Wrong answer0/01ms320 KiB
2Wrong answer0/01ms320 KiB
3Wrong answer0/21ms320 KiB
4Wrong answer0/21ms320 KiB
5Wrong answer0/21ms352 KiB
6Wrong answer0/21ms320 KiB
7Wrong answer0/21ms320 KiB
8Wrong answer0/31ms320 KiB
9Wrong answer0/31ms320 KiB
10Wrong answer0/31ms320 KiB
11Wrong answer0/31ms320 KiB
12Wrong answer0/31ms588 KiB
13Wrong answer0/31ms320 KiB
14Wrong answer0/31ms324 KiB
15Wrong answer0/31ms320 KiB
16Wrong answer0/31ms500 KiB
17Wrong answer0/31ms320 KiB