87622024-01-29 15:11:49Balki22Toronyépítés (80 pont)cpp17Runtime error 78/8019ms19100 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n; cin >> n;
	vector<long long> dp(n, 0);
	dp[0] = 1;
	dp[1] = 3;
	for (int i = 2; i <= n; i++) {
		dp[i] = ((3 * dp[i-1]) % 20210108 + dp[i-2]) % 20210108;
	}
	cout << dp[n];
}
SubtaskSumTestVerdictTimeMemory
base78/80
1Runtime error0/03ms1916 KiB
2Runtime error0/03ms2024 KiB
3Accepted4/43ms2120 KiB
4Accepted4/43ms2352 KiB
5Accepted5/53ms2676 KiB
6Accepted5/53ms2800 KiB
7Accepted6/619ms18668 KiB
8Accepted6/64ms5152 KiB
9Accepted7/73ms3460 KiB
10Accepted7/73ms3820 KiB
11Accepted8/86ms6900 KiB
12Accepted8/819ms19100 KiB
13Accepted8/817ms17472 KiB
14Accepted8/88ms8980 KiB
15Runtime error0/23ms4160 KiB
16Accepted2/23ms4192 KiB