61112023-10-31 21:36:26hackemonJardaTcpp17Accepted 40/403ms3908 KiB
#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n;
    long long modul = 20200111;
            cin >> n;
            vector<long long> ans(101), nyitott(101, 1);
            ans[1] = 1;
            ans[2] = 2;
            ans[3] = 5;
            nyitott[3] = 2;
            nyitott[4] = 5;
            ans[4] = ans[3] + ans[2] + nyitott[3] * 2;
            for(int i = 5;i<=n;i++ ) {
                nyitott[i] = (nyitott[i-1] + nyitott[i-2] + ans[i-2])%modul;
                ans[i] = (ans[i-1] + ans[i-2] + nyitott[i-1]*2)%modul; 
            }
            
         cout << ans[n]%modul << endl;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/03ms1808 KiB
2Accepted0/03ms2056 KiB
3Accepted1/13ms2276 KiB
4Accepted1/13ms2424 KiB
5Accepted2/23ms2580 KiB
6Accepted2/22ms2644 KiB
7Accepted3/33ms2904 KiB
8Accepted3/33ms3108 KiB
9Accepted3/32ms3100 KiB
10Accepted3/32ms3232 KiB
11Accepted3/33ms3440 KiB
12Accepted3/32ms3528 KiB
13Accepted3/33ms3608 KiB
14Accepted3/32ms3572 KiB
15Accepted3/33ms3708 KiB
16Accepted3/32ms3784 KiB
17Accepted4/42ms3908 KiB