64952023-12-05 09:56:41BenedekMartonJardaTcpp11Runtime error 39/403ms4268 KiB
#include <iostream>

using namespace std;

int main()
{
    int n;
    cin >> n;
    unsigned long long fd[n+1], h[n+1];
    fd[1]=1;
    fd[2]=1;
    fd[3]=2;
    fd[4]=2;
    for(int i=5; i<=n; i++)
    {
        fd[i]=fd[i-1]+fd[i-2];
        fd[i]=fd[i]%20200111;
    }
    h[0]=1;
    for(int i=1; i<=n; i++)
    {
        h[i]=0;
        for(int j=0; j<i; j++)
        {
            h[i]=h[i]+h[j]*fd[i-j]%20200111;
        }
        h[i]=h[i]%20200111;
    }
    cout << h[n];
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base39/40
1Accepted0/03ms1876 KiB
2Accepted0/03ms2120 KiB
3Runtime error0/13ms2316 KiB
4Accepted1/13ms2452 KiB
5Accepted2/23ms2496 KiB
6Accepted2/23ms2576 KiB
7Accepted3/33ms2704 KiB
8Accepted3/33ms2944 KiB
9Accepted3/33ms3196 KiB
10Accepted3/33ms3212 KiB
11Accepted3/33ms3336 KiB
12Accepted3/33ms3584 KiB
13Accepted3/33ms3636 KiB
14Accepted3/33ms3768 KiB
15Accepted3/33ms4004 KiB
16Accepted3/33ms4228 KiB
17Accepted4/42ms4268 KiB