50852023-04-16 10:53:29Laci3000Toronyépítés (1,1,3,3)cpp17Wrong answer 26/5013ms18968 KiB

#include <iostream>
#include <vector>

using namespace std;

int main()
{

	int hossz;
	cin >> hossz;

	vector<long long> lista(hossz);

	lista[0] = 2;
	if (hossz > 1) {
		lista[1] = 4;
	}if (hossz > 2) {
		lista[2] = 10;
	}
	if (hossz > 3) {
		for (size_t i = 3; i < hossz; i++)
		{
			lista[i] = lista[i - 1] * 2 + lista[i - 3] * 2;
		}
	}
	cout << lista[hossz - 1] % 20210108;
}

SubtaskSumTestVerdictTimeMemory
base26/50
1Accepted0/03ms1808 KiB
2Wrong answer0/03ms2072 KiB
3Accepted3/33ms2272 KiB
4Accepted3/33ms2492 KiB
5Accepted4/43ms2708 KiB
6Accepted4/42ms2800 KiB
7Wrong answer0/413ms18448 KiB
8Wrong answer0/44ms5148 KiB
9Accepted4/43ms3300 KiB
10Accepted4/43ms3440 KiB
11Wrong answer0/44ms6692 KiB
12Wrong answer0/412ms18968 KiB
13Wrong answer0/49ms17260 KiB
14Wrong answer0/44ms8720 KiB
15Accepted2/23ms3856 KiB
16Accepted2/22ms4104 KiB