15582022-11-25 11:46:27bzsofiaJárda-L (40)cpp11Runtime error 0/403ms3816 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] = 11;
	x[5] = 5;

	for (i = 6; 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
1Runtime error0/03ms1920 KiB
2Wrong answer0/02ms2004 KiB
3Runtime error0/22ms2316 KiB
4Runtime error0/22ms2580 KiB
5Runtime error0/22ms2780 KiB
6Wrong answer0/22ms2940 KiB
7Wrong answer0/22ms2956 KiB
8Wrong answer0/32ms2956 KiB
9Wrong answer0/32ms3208 KiB
10Wrong answer0/32ms3216 KiB
11Wrong answer0/32ms3468 KiB
12Wrong answer0/32ms3672 KiB
13Wrong answer0/32ms3628 KiB
14Wrong answer0/32ms3752 KiB
15Wrong answer0/32ms3756 KiB
16Wrong answer0/32ms3784 KiB
17Wrong answer0/32ms3816 KiB