4022021-11-03 08:32:24DomiKuiToronyépítés (1,1,3,3)cpp11Accepted 50/5012ms9444 KiB
// torony1133.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include <vector>
#include <stack>
#include <algorithm>
using namespace std;
	

int main()
{
	int magassag;
	cin >> magassag;
	vector<int> lista(magassag);

	lista[0] = 2;
	lista[1] = 4;
	lista[2] = 10;
	for (int i = 3; i < magassag; i++)
	{
		lista[i] = (2 * lista[i - 1] + 2*lista[i - 3])%20210108;

	}
	int valasz = lista[magassag-1];
	cout << valasz;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/02ms1736 KiB
2Accepted0/01ms1772 KiB
3Accepted3/31ms1824 KiB
4Accepted3/31ms1824 KiB
5Accepted4/41ms1720 KiB
6Accepted4/41ms1824 KiB
7Accepted4/412ms9444 KiB
8Accepted4/42ms2556 KiB
9Accepted4/41ms1824 KiB
10Accepted4/41ms1828 KiB
11Accepted4/43ms3204 KiB
12Accepted4/412ms9440 KiB
13Accepted4/410ms8404 KiB
14Accepted4/44ms4240 KiB
15Accepted2/21ms1824 KiB
16Accepted2/21ms1824 KiB