7342022-01-01 11:02:44kismartongToronyépítés (2,2,3,3)cpp14Accepted 40/404ms4152 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n;
	cin >> n;
	vector<int> dp;
	dp.push_back(0);
	dp.push_back(2);
	dp.push_back(2);
	for (int i = 3; i < n; i++) {
		dp.push_back((2*dp[i-2] + 2*dp[i-3])%20210108);
	}
	cout << dp[n-1] << '\n';
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/02ms1948 KiB
2Accepted0/01ms2036 KiB
3Accepted2/21ms2052 KiB
4Accepted2/21ms2060 KiB
5Accepted3/31ms2064 KiB
6Accepted3/31ms2064 KiB
7Accepted3/34ms4124 KiB
8Accepted3/33ms3232 KiB
9Accepted3/31ms2076 KiB
10Accepted3/31ms2080 KiB
11Accepted3/34ms4144 KiB
12Accepted3/33ms4148 KiB
13Accepted4/43ms4148 KiB
14Accepted4/43ms4152 KiB
15Accepted2/21ms2104 KiB
16Accepted2/21ms2100 KiB