34412023-02-27 19:33:18nkdorka1212Járda-L (40)cpp17Wrong answer 4/4043ms4020 KiB
#include <bits/stdc++.h>

using namespace std;

int solve(int n)
{
    if(n==0)
    {
        return 1;
    }
    if(n==1)
    {
        return 1;
    }
    if(n==2)
    {
        return 2;
    }
    return solve(n-1)+solve(n-2)+2*solve(n-3);
}

int main()
{
    int n;
    cin>>n;
    cout<<solve(n)<<"\n";
    return 0;
}




SubtaskSumTestVerdictTimeMemory
base4/40
1Accepted0/03ms1880 KiB
2Wrong answer0/06ms2116 KiB
3Accepted2/22ms2324 KiB
4Accepted2/23ms2496 KiB
5Wrong answer0/23ms2708 KiB
6Wrong answer0/23ms2944 KiB
7Wrong answer0/23ms3028 KiB
8Wrong answer0/33ms3024 KiB
9Wrong answer0/33ms3156 KiB
10Wrong answer0/33ms3644 KiB
11Wrong answer0/33ms3744 KiB
12Wrong answer0/33ms3884 KiB
13Wrong answer0/38ms4020 KiB
14Wrong answer0/314ms3988 KiB
15Wrong answer0/325ms3820 KiB
16Wrong answer0/343ms3936 KiB
17Wrong answer0/34ms3948 KiB