125012024-12-19 12:29:27vauvau6Já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;
    if(n>4)
    {
        for(i=5;i<=n;++i)
        {
            v[i]=2*v[i-2]+2*v[i-4]+6*(i-4);
        }
    }
    cout<<v[n];
}
SubtaskSumTestVerdictTimeMemory
base4/40
1Accepted0/01ms320 KiB
2Wrong answer0/01ms320 KiB
3Accepted2/21ms320 KiB
4Accepted2/21ms320 KiB
5Wrong answer0/21ms320 KiB
6Wrong answer0/21ms320 KiB
7Wrong answer0/21ms364 KiB
8Wrong answer0/31ms320 KiB
9Wrong answer0/31ms320 KiB
10Wrong answer0/31ms320 KiB
11Wrong answer0/31ms508 KiB
12Wrong answer0/31ms320 KiB
13Wrong answer0/31ms320 KiB
14Wrong answer0/31ms320 KiB
15Wrong answer0/31ms320 KiB
16Wrong answer0/31ms320 KiB
17Wrong answer0/31ms320 KiB