65612023-12-11 14:38:18Balki22Toronyépítés (2,2,3,3)cpp17Runtime error 36/404ms6228 KiB
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <cmath>
#include <map>
#include <unordered_set>
#include <unordered_map>

using namespace std;

int main()
{
	int n; cin >> n;
	vector<unsigned long long> dp(n + 1, 0);
	dp[0] = 1;
	dp[1] = 0;
	dp[2] = 2;
	dp[3] = 2;

	for (int i = 4; i <= n; i++) {
		dp[i] = (((2 * dp[i - 2]) % 20210108) + ((2 * dp[i - 3]) % 20210108)) % 20210108;
	}
	cout << dp[n];
}

SubtaskSumTestVerdictTimeMemory
base36/40
1Accepted0/03ms1964 KiB
2Accepted0/03ms2060 KiB
3Accepted2/23ms2260 KiB
4Runtime error0/23ms2584 KiB
5Accepted3/33ms2696 KiB
6Accepted3/33ms2780 KiB
7Accepted3/34ms5700 KiB
8Accepted3/34ms4860 KiB
9Accepted3/33ms3132 KiB
10Accepted3/33ms3348 KiB
11Accepted3/34ms6224 KiB
12Accepted3/34ms6228 KiB
13Accepted4/44ms5836 KiB
14Accepted4/44ms5324 KiB
15Accepted2/23ms3460 KiB
16Runtime error0/23ms3556 KiB