15622022-11-25 11:54:06DragonoidOmegaJardaTcpp11Accepted 40/403ms3580 KiB
#include <iostream>

using namespace std;

int x[101],f[101];
int i,n;
int main()
{
    x[1]=1;
    x[2]=2;
    f[2]=2;


    cin>>n;


    for(i=3;i<=n;++i)
    {
        x[i]=(((x[i-1]+x[i-2])%20200111)+f[i-1])%20200111;
        f[i]=(((((x[i-2]+f[i-2])%20200111)+f[i-1])%20200111)+x[i-2])%20200111;

    }

    cout<<x[n];
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/03ms1872 KiB
2Accepted0/02ms2064 KiB
3Accepted1/12ms2148 KiB
4Accepted1/12ms2272 KiB
5Accepted2/22ms2480 KiB
6Accepted2/22ms2680 KiB
7Accepted3/32ms2884 KiB
8Accepted3/32ms3088 KiB
9Accepted3/32ms3160 KiB
10Accepted3/32ms3288 KiB
11Accepted3/32ms3412 KiB
12Accepted3/32ms3416 KiB
13Accepted3/32ms3540 KiB
14Accepted3/32ms3568 KiB
15Accepted3/32ms3576 KiB
16Accepted3/32ms3580 KiB
17Accepted4/42ms3576 KiB