3212021-10-08 14:27:19nemSomaToronyépítés (1,1,3,3)cpp11Accepted 50/5019ms14272 KiB
// Toronyepites.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<int> v{2, 4, 10};
	for (int i = 3; i < N; i++)
	{
		v.push_back(2 * (v[i - 3] + v[i - 1]) % 20210108);
	}
	cout << v[N - 1];
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/02ms1740 KiB
2Accepted0/01ms1800 KiB
3Accepted3/31ms1840 KiB
4Accepted3/32ms1852 KiB
5Accepted4/41ms1852 KiB
6Accepted4/41ms1856 KiB
7Accepted4/419ms14244 KiB
8Accepted4/44ms3580 KiB
9Accepted4/41ms1864 KiB
10Accepted4/41ms1868 KiB
11Accepted4/44ms5080 KiB
12Accepted4/417ms14264 KiB
13Accepted4/417ms14272 KiB
14Accepted4/46ms5092 KiB
15Accepted2/22ms1892 KiB
16Accepted2/21ms1900 KiB