23412023-01-10 18:12:42nmarciToronyépítés (2,2,3,3)cpp11Accepted 40/404ms6704 KiB
#include <bits/stdc++.h>

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

const ll mod = 20210108;

int main()
{
  int n;
  cin >> n;
  vector<ll> v(n + 1);
  v[0] = 1; v[1] = 0; v[2] = 2; 
  for(int i = 3; i <= n; ++i){
    v[i] = (v[i - 2] * 2 + v[i - 3] * 2) % mod;
  }
  cout << v[n] << endl;
  return 0;
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/03ms2088 KiB
2Accepted0/02ms2236 KiB
3Accepted2/22ms2252 KiB
4Accepted2/22ms2416 KiB
5Accepted3/32ms2616 KiB
6Accepted3/32ms2824 KiB
7Accepted3/34ms5816 KiB
8Accepted3/33ms4900 KiB
9Accepted3/32ms3316 KiB
10Accepted3/32ms3364 KiB
11Accepted3/34ms6484 KiB
12Accepted3/34ms6704 KiB
13Accepted4/44ms6500 KiB
14Accepted4/43ms6156 KiB
15Accepted2/22ms4476 KiB
16Accepted2/22ms4432 KiB