3232021-10-08 14:29:48OlgipolgiiToronyépítés (1,1,3,3)cpp11Wrong answer 18/5024ms26376 KiB
// torony.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

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

int main()
{
	int n;
	cin >> n;
    vector<unsigned long long int> tower{ 2, 4, 10 };
	for (size_t i = 0; i < n; i++)
	{
		if (i>=3)
		{
			tower.push_back(2 * tower[i - 1] + 2 * tower[i - 3] % 20210108);
		}
	}
	unsigned long long int k = tower[n - 1];
	cout << k;
}

SubtaskSumTestVerdictTimeMemory
base18/50
1Accepted0/02ms1740 KiB
2Wrong answer0/01ms1844 KiB
3Accepted3/31ms1732 KiB
4Accepted3/31ms1732 KiB
5Wrong answer0/41ms1732 KiB
6Wrong answer0/41ms1836 KiB
7Wrong answer0/424ms26376 KiB
8Wrong answer0/43ms5048 KiB
9Accepted4/41ms1836 KiB
10Accepted4/41ms1840 KiB
11Wrong answer0/46ms8008 KiB
12Wrong answer0/420ms26376 KiB
13Wrong answer0/420ms26376 KiB
14Wrong answer0/48ms8012 KiB
15Accepted2/21ms1840 KiB
16Accepted2/21ms1736 KiB