138352025-01-08 20:48:46mateJárda-L (40)cpp17Wrong answer 4/401ms556 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n; cin >> n;
	vector <int> dp(30);
	dp[0] = 1;
	dp[1] = 1;
	dp[2] = 2;
	dp[3] = 5;
	for(int i = 4; i <= 29; i++){
		dp[i] = dp[i-3] + dp[i-2] + dp[i-1];
	}
	cout << dp[n];
	
}
SubtaskSumTestVerdictTimeMemory
base4/40
1Accepted0/01ms316 KiB
2Wrong answer0/01ms316 KiB
3Accepted2/21ms556 KiB
4Accepted2/21ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms392 KiB
7Wrong answer0/21ms316 KiB
8Wrong answer0/31ms316 KiB
9Wrong answer0/31ms316 KiB
10Wrong answer0/31ms316 KiB
11Wrong answer0/31ms316 KiB
12Wrong answer0/31ms316 KiB
13Wrong answer0/31ms316 KiB
14Wrong answer0/31ms316 KiB
15Wrong answer0/31ms316 KiB
16Wrong answer0/31ms316 KiB
17Wrong answer0/31ms512 KiB