65152023-12-05 18:51:33antiJárda-L (40)cpp14Wrong answer 4/403ms4160 KiB
#include <iostream>
#include <vector>

using namespace std;

int main()
{
	int n;
	cin >> n;
	vector<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/03ms1680 KiB
2Wrong answer0/03ms1848 KiB
3Accepted2/23ms2064 KiB
4Accepted2/23ms2268 KiB
5Wrong answer0/23ms2488 KiB
6Wrong answer0/23ms2696 KiB
7Wrong answer0/23ms2908 KiB
8Wrong answer0/33ms3000 KiB
9Wrong answer0/33ms3120 KiB
10Wrong answer0/33ms3312 KiB
11Wrong answer0/33ms3396 KiB
12Wrong answer0/33ms3520 KiB
13Wrong answer0/33ms3608 KiB
14Wrong answer0/33ms3604 KiB
15Wrong answer0/33ms3860 KiB
16Wrong answer0/33ms3944 KiB
17Wrong answer0/33ms4160 KiB