6762021-11-08 19:05:35arralToronyépítés (2,2,3,3)cpp11Accepted 40/403ms3388 KiB
#include <iostream>
#include <vector>
using namespace std;
int main()
{

	int magassag = 0;
	cin >> magassag;
	vector<int> lista(magassag + 1, 0);
	lista[1] = 0;
	lista[2] = 2;
	lista[3] = 2;
	lista[4] = 4;
	lista[5] = 8;
	for (int i = 6; i < magassag + 1; i++)
	{
		lista[i] = (2 * lista[i - 3] + 2 * lista[i - 2]) % 20210108;
	}
	cout << lista[magassag];

}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/02ms1920 KiB
2Accepted0/01ms1948 KiB
3Accepted2/21ms1988 KiB
4Accepted2/21ms1996 KiB
5Accepted3/31ms2004 KiB
6Accepted3/31ms2000 KiB
7Accepted3/33ms3388 KiB
8Accepted3/32ms2744 KiB
9Accepted3/31ms2016 KiB
10Accepted3/31ms2020 KiB
11Accepted3/33ms3272 KiB
12Accepted3/32ms3276 KiB
13Accepted4/42ms3284 KiB
14Accepted4/42ms2892 KiB
15Accepted2/21ms1936 KiB
16Accepted2/21ms2044 KiB