3132021-10-06 10:09:16OlgipolgiiToronyépítés (1,1,3,3)cpp11Wrong answer 26/5030ms26424 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]);
		}
	}
	unsigned long long int k = tower[n - 1] % 20210108;
	cout << k;
}

SubtaskSumTestVerdictTimeMemory
base26/50
1Accepted0/02ms1744 KiB
2Wrong answer0/02ms1816 KiB
3Accepted3/31ms1852 KiB
4Accepted3/31ms1840 KiB
5Accepted4/41ms1852 KiB
6Accepted4/41ms1856 KiB
7Wrong answer0/430ms26412 KiB
8Wrong answer0/44ms5068 KiB
9Accepted4/41ms1868 KiB
10Accepted4/41ms1872 KiB
11Wrong answer0/48ms8060 KiB
12Wrong answer0/421ms26420 KiB
13Wrong answer0/420ms26424 KiB
14Wrong answer0/47ms8064 KiB
15Accepted2/21ms1892 KiB
16Accepted2/21ms1896 KiB