4082021-11-03 08:36:58xxxxxxxxxxToronyépítés (1,1,3,3)cpp11Runtime error 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
SubtaskSumTestVerdictTimeMemory
base45/50
1Accepted0/02ms1740 KiB
2Accepted0/01ms1812 KiB
3Accepted3/31ms1724 KiB
4Runtime error0/31ms1812 KiB
5Accepted4/41ms1824 KiB
6Accepted4/41ms1720 KiB
7Accepted4/418ms17368 KiB
8Accepted4/43ms3592 KiB
9Accepted4/41ms1828 KiB
10Accepted4/41ms1824 KiB
11Accepted4/44ms4764 KiB
12Accepted4/419ms16980 KiB
13Accepted4/417ms15288 KiB
14Accepted4/48ms6840 KiB
15Accepted2/21ms1720 KiB
16Runtime error0/21ms1816 KiB