15562022-11-25 11:43:32bzsofiaJárda-L (40)cpp11Wrong answer 2/403ms4296 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;

	for (i = 4; 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
base2/40
1Accepted0/03ms1808 KiB
2Wrong answer0/02ms2056 KiB
3Runtime error0/22ms2228 KiB
4Runtime error0/22ms2412 KiB
5Accepted2/22ms2672 KiB
6Wrong answer0/22ms2724 KiB
7Wrong answer0/22ms2852 KiB
8Wrong answer0/32ms3100 KiB
9Wrong answer0/32ms3264 KiB
10Wrong answer0/32ms3376 KiB
11Wrong answer0/32ms3464 KiB
12Wrong answer0/32ms3864 KiB
13Wrong answer0/32ms3956 KiB
14Wrong answer0/32ms4068 KiB
15Wrong answer0/32ms4180 KiB
16Wrong answer0/32ms4168 KiB
17Wrong answer0/32ms4296 KiB