110762024-07-06 12:46:19KarolinaToronyépítés (80 pont)cpp17Accepted 80/8012ms4728 KiB
#include <iostream>
#include<vector>
using namespace std;

int main()
{
	iostream::sync_with_stdio(0);
	cin.tie(0);

	int n, x;
	cin >> n;

	vector<int> vec(n + 1);
	vec[1] = 3;
	vec[2] = 10;

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

	cout << vec[n];

	


}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/03ms404 KiB
2Accepted0/03ms504 KiB
3Accepted4/43ms356 KiB
4Accepted4/43ms356 KiB
5Accepted5/53ms328 KiB
6Accepted5/53ms500 KiB
7Accepted6/612ms4728 KiB
8Accepted6/64ms872 KiB
9Accepted7/72ms356 KiB
10Accepted7/73ms376 KiB
11Accepted8/84ms1128 KiB
12Accepted8/812ms4144 KiB
13Accepted8/812ms3816 KiB
14Accepted8/86ms1912 KiB
15Accepted2/23ms528 KiB
16Accepted2/22ms372 KiB