4102021-11-03 08:39:59arralToronyépítés (1,1,3,3)cpp11Accepted 50/5013ms9444 KiB
#include <iostream>
#include <vector>
using namespace std;
int main()
{
   
	int magassag=0;
	cin >> magassag;
	vector<int> lista(magassag+1,0);
	lista[1] = 2;
	lista[2] = 4;
	lista[3] = 10;
	for (int i = 4; i < magassag+1; i++)
	{
		lista[i] = (2*lista[i - 3] + 2*lista[i-1]) % 20210108;
	}
	cout << lista[magassag];


}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/02ms1744 KiB
2Accepted0/01ms1772 KiB
3Accepted3/31ms1824 KiB
4Accepted3/31ms1720 KiB
5Accepted4/41ms1824 KiB
6Accepted4/41ms1720 KiB
7Accepted4/413ms9444 KiB
8Accepted4/43ms2552 KiB
9Accepted4/41ms1824 KiB
10Accepted4/41ms1824 KiB
11Accepted4/44ms3204 KiB
12Accepted4/413ms9440 KiB
13Accepted4/410ms8404 KiB
14Accepted4/46ms4240 KiB
15Accepted2/22ms1828 KiB
16Accepted2/21ms1824 KiB