65172023-12-05 18:57:24antiJárda-L (40)cpp14Wrong answer 4/403ms3728 KiB
#include <iostream>
#include <vector>

using namespace std;

int main()
{
	int n;
	cin >> n;
	vector<long long int> V;
	for (int i = 0; i < n; i++) {
		V.push_back(0);
	}
	V[0] = 1;
	V[1] = 1;
	V[2] = 2;
	for (int i = 3; i < n; i++) {
		V[i] = V[i - 1] * 2 + V[i - 3];
	}
	cout << V[n];
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base4/40
1Wrong answer0/03ms1808 KiB
2Wrong answer0/03ms2000 KiB
3Accepted2/23ms2364 KiB
4Accepted2/22ms2268 KiB
5Wrong answer0/23ms2460 KiB
6Wrong answer0/22ms2484 KiB
7Wrong answer0/22ms2484 KiB
8Wrong answer0/33ms2616 KiB
9Wrong answer0/33ms2824 KiB
10Wrong answer0/33ms3040 KiB
11Wrong answer0/33ms3116 KiB
12Wrong answer0/33ms3264 KiB
13Wrong answer0/33ms3324 KiB
14Wrong answer0/33ms3524 KiB
15Wrong answer0/33ms3600 KiB
16Wrong answer0/33ms3728 KiB
17Wrong answer0/33ms3604 KiB