15572022-11-25 11:44:40bzsofiaJárda-L (40)cpp11Wrong answer 0/403ms4124 KiB
// Jarda I es L alaku jarolapokkal.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include <vector>

using namespace std;

int i, n;

int main()
{
	cin >> n;

	vector <long long> x(n + 1);

	x[1] = 1;
	x[2] = 2;
	x[3] = 5;
	x[4] = 0;

	for (i = 5; i <= n; ++i)
	{
		x[i] = x[i - 1] + 2 * x[i - 2] + 2 * x[i - 3];
	}

	cout << x[n];
	return 0;
}

// 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
base0/40
1Accepted0/03ms1808 KiB
2Wrong answer0/02ms2008 KiB
3Runtime error0/22ms2316 KiB
4Runtime error0/22ms2664 KiB
5Wrong answer0/22ms2504 KiB
6Wrong answer0/22ms2572 KiB
7Wrong answer0/22ms2820 KiB
8Wrong answer0/32ms2908 KiB
9Wrong answer0/32ms2980 KiB
10Wrong answer0/32ms3112 KiB
11Wrong answer0/32ms3348 KiB
12Wrong answer0/32ms3620 KiB
13Wrong answer0/32ms3652 KiB
14Wrong answer0/32ms3904 KiB
15Wrong answer0/32ms4124 KiB
16Wrong answer0/32ms4044 KiB
17Wrong answer0/32ms4048 KiB