125902024-12-25 18:16:50KissCsongor777Járda-L (40)cpp17Wrong answer 4/401ms508 KiB
#include <iostream>

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