4082021-11-03 08:36:58xxxxxxxxxxToronyépítés (1,1,3,3)cpp11Futási hiba 45/5019ms17368 KiB
// domino.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<long> sor(N + 1);

	sor[0] = 1;
	sor[1] = 2;
	sor[2] = 4;
	sor[3] = 10;

	for (int i = 4; i < N + 1; i++)
	{
		sor[i] = ((sor[i - 1] % 20210108 + sor[i - 3] % 20210108) * 2) % 20210108;
	}

	cout << sor[N];
}

// 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
base45/50
1Elfogadva0/02ms1740 KiB
2Elfogadva0/01ms1812 KiB
3Elfogadva3/31ms1724 KiB
4Futási hiba0/31ms1812 KiB
5Elfogadva4/41ms1824 KiB
6Elfogadva4/41ms1720 KiB
7Elfogadva4/418ms17368 KiB
8Elfogadva4/43ms3592 KiB
9Elfogadva4/41ms1828 KiB
10Elfogadva4/41ms1824 KiB
11Elfogadva4/44ms4764 KiB
12Elfogadva4/419ms16980 KiB
13Elfogadva4/417ms15288 KiB
14Elfogadva4/48ms6840 KiB
15Elfogadva2/21ms1720 KiB
16Futási hiba0/21ms1816 KiB