3202021-10-08 14:24:38Kalman426Toronyépítés (1,1,3,3)cpp11Elfogadva 50/5017ms14264 KiB
// járdakövezés.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include <vector>

using namespace std;

int main()
{

	int k;
	cin >> k;

	vector<int> variaciok{ 2,4,10 };

	for (size_t i = 3; i < k; i++)
	{
		variaciok.push_back(2*(variaciok[i - 1] + variaciok[i - 3]) % 20210108);
	}
	cout << variaciok[k - 1];
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started: 
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file
RészfeladatÖsszpontTesztVerdiktIdőMemória
base50/50
1Elfogadva0/02ms1740 KiB
2Elfogadva0/01ms1796 KiB
3Elfogadva3/31ms1848 KiB
4Elfogadva3/31ms1848 KiB
5Elfogadva4/41ms1860 KiB
6Elfogadva4/41ms1860 KiB
7Elfogadva4/417ms14224 KiB
8Elfogadva4/43ms3584 KiB
9Elfogadva4/41ms1872 KiB
10Elfogadva4/41ms1872 KiB
11Elfogadva4/44ms5080 KiB
12Elfogadva4/417ms14264 KiB
13Elfogadva4/416ms14264 KiB
14Elfogadva4/46ms5096 KiB
15Elfogadva2/21ms1892 KiB
16Elfogadva2/21ms1900 KiB