110742024-07-06 12:39:33KarolinaToronyépítés (80 pont)python3Runtime error 0/8017ms3064 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
base0/80
1Runtime error0/017ms2916 KiB
2Runtime error0/017ms2920 KiB
3Runtime error0/417ms2916 KiB
4Runtime error0/417ms2916 KiB
5Runtime error0/517ms2916 KiB
6Runtime error0/517ms2916 KiB
7Runtime error0/617ms2788 KiB
8Runtime error0/617ms2916 KiB
9Runtime error0/717ms2808 KiB
10Runtime error0/717ms2920 KiB
11Runtime error0/817ms2916 KiB
12Runtime error0/817ms2916 KiB
13Runtime error0/817ms3060 KiB
14Runtime error0/817ms2844 KiB
15Runtime error0/217ms2828 KiB
16Runtime error0/217ms3064 KiB