15612022-11-25 11:50:01DragonoidOmegaJardaTcpp11Accepted 40/403ms3700 KiB
#include <iostream>

using namespace std;

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


    cin>>n;


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

    cout<<x[n];
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/03ms1880 KiB
2Accepted0/02ms2120 KiB
3Accepted1/12ms2324 KiB
4Accepted1/12ms2524 KiB
5Accepted2/22ms2684 KiB
6Accepted2/22ms2760 KiB
7Accepted3/32ms3000 KiB
8Accepted3/32ms2992 KiB
9Accepted3/32ms3188 KiB
10Accepted3/32ms3436 KiB
11Accepted3/32ms3500 KiB
12Accepted3/32ms3468 KiB
13Accepted3/32ms3468 KiB
14Accepted3/32ms3476 KiB
15Accepted3/32ms3480 KiB
16Accepted3/32ms3580 KiB
17Accepted4/42ms3700 KiB