50872023-04-16 11:10:25Laci3000Toronyépítés (80 pont)cpp17Wrong answer 78/8017ms18932 KiB

#include <iostream>
#include <vector>

using namespace std;

int main()
{

	int hossz;
	cin >> hossz;

	vector<long long> lista(hossz);

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

	cout << lista[hossz - 1];
}

SubtaskSumTestVerdictTimeMemory
base78/80
1Accepted0/03ms1808 KiB
2Accepted0/03ms2184 KiB
3Accepted4/42ms2240 KiB
4Accepted4/43ms2488 KiB
5Accepted5/53ms2544 KiB
6Accepted5/53ms2744 KiB
7Accepted6/617ms18484 KiB
8Accepted6/64ms5192 KiB
9Accepted7/73ms3372 KiB
10Accepted7/73ms3480 KiB
11Accepted8/84ms6524 KiB
12Accepted8/816ms18932 KiB
13Accepted8/814ms17504 KiB
14Accepted8/87ms9132 KiB
15Wrong answer0/23ms4172 KiB
16Accepted2/23ms4260 KiB