22712023-01-08 22:48:50nmarciJardaTcpp11Accepted 40/403ms3648 KiB
#include <bits/stdc++.h>

using namespace std;
using ll = long long int;
const ll inf = 1e9;

const ll mod = 20200111;

ll dp[110][2] = {0};
int main()
{
  int n;
  cin >> n;
  dp[1][0] = 1;
  dp[2][0] = 2;
  dp[2][1] = 2;
  for(int i = 3; i <= n; ++i){
    dp[i][0] = (dp[i - 1][0] + dp[i - 2][0] + dp[i - 1][1]) % mod;
    dp[i][1] = (dp[i - 2][0] * 2 + dp[i - 2][1] + dp[i - 1][1]) % mod;
  }
  cout << dp[n][0] << endl;
  return 0;
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/03ms1876 KiB
2Accepted0/02ms2096 KiB
3Accepted1/12ms2208 KiB
4Accepted1/12ms2416 KiB
5Accepted2/22ms2488 KiB
6Accepted2/22ms2648 KiB
7Accepted3/32ms2724 KiB
8Accepted3/32ms2852 KiB
9Accepted3/32ms3004 KiB
10Accepted3/32ms2928 KiB
11Accepted3/32ms3060 KiB
12Accepted3/32ms3136 KiB
13Accepted3/32ms3420 KiB
14Accepted3/32ms3280 KiB
15Accepted3/32ms3280 KiB
16Accepted3/32ms3404 KiB
17Accepted4/42ms3648 KiB