65072023-12-05 10:21:22BenedekMartonJardaTcpp14Accepted 40/403ms3848 KiB
#include <iostream>

using namespace std;

int main()
{
    int n;
    cin >> n;
    if(n==1)
    {
        cout << 1;
        return 0;
    }
    long int 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;
    }
    /*for(int i=0; i<n; i++)
    {
        cout << h[i] << " ";
    }*/
    cout << h[n];
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/03ms1876 KiB
2Accepted0/03ms2068 KiB
3Accepted1/13ms2560 KiB
4Accepted1/13ms2656 KiB
5Accepted2/23ms2864 KiB
6Accepted2/23ms3108 KiB
7Accepted3/33ms3128 KiB
8Accepted3/33ms3220 KiB
9Accepted3/33ms3304 KiB
10Accepted3/33ms3432 KiB
11Accepted3/33ms3516 KiB
12Accepted3/32ms3520 KiB
13Accepted3/32ms3524 KiB
14Accepted3/33ms3652 KiB
15Accepted3/32ms3732 KiB
16Accepted3/33ms3848 KiB
17Accepted4/43ms3644 KiB