29262023-02-04 14:49:16horvathabelJárda-L (40)cpp17Wrong answer 4/403ms3888 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;
	cin>>n;
	vector<int> dp={1,1,2};
	for (int i=3; i<=n;i++){
		int ans=0;
		ans+=dp[i-3]*2;
		ans+=dp[i-2];
		ans+=dp[i-1];
		dp.push_back(ans);
	}
	cout<<dp[n];
}
SubtaskSumTestVerdictTimeMemory
base4/40
1Accepted0/03ms1812 KiB
2Wrong answer0/03ms2060 KiB
3Accepted2/23ms2268 KiB
4Accepted2/22ms2352 KiB
5Wrong answer0/23ms2608 KiB
6Wrong answer0/23ms2724 KiB
7Wrong answer0/22ms2744 KiB
8Wrong answer0/33ms2836 KiB
9Wrong answer0/33ms2848 KiB
10Wrong answer0/32ms2936 KiB
11Wrong answer0/33ms3196 KiB
12Wrong answer0/33ms3284 KiB
13Wrong answer0/33ms3520 KiB
14Wrong answer0/33ms3656 KiB
15Wrong answer0/33ms3860 KiB
16Wrong answer0/33ms3816 KiB
17Wrong answer0/32ms3888 KiB