66902023-12-16 19:06:05111Toronyépítés (2,2,3,3)cpp17Accepted 40/404ms5948 KiB
#include <bits/stdc++.h>
using namespace std;

#define int long long
#define double long double

#define pii pair<int, int>

#define MOD 20210108

signed main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
#ifdef CB
	freopen("be1.txt", "r", stdin);
//	freopen("out.txt", "w", stdout);
#endif
	int N;
	cin >> N;
	vector<int> v(N + 1);
	v[0] = 1;
	v[1] = 0;
	v[2] = 2;
	v[3] = 2;
	for (int i = 4; i <= N; i++) {
		v[i] = v[i - 2] * 2 + v[i - 3] * 2;
		v[i] %= MOD;
	}
	cout << v[N] << endl;
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/03ms1832 KiB
2Accepted0/03ms2036 KiB
3Accepted2/23ms2240 KiB
4Accepted2/23ms2460 KiB
5Accepted3/33ms2556 KiB
6Accepted3/32ms2780 KiB
7Accepted3/34ms5852 KiB
8Accepted3/34ms4952 KiB
9Accepted3/33ms3048 KiB
10Accepted3/33ms3056 KiB
11Accepted3/34ms5948 KiB
12Accepted3/34ms5824 KiB
13Accepted4/44ms5560 KiB
14Accepted4/44ms4912 KiB
15Accepted2/23ms3184 KiB
16Accepted2/22ms3260 KiB