181502025-10-06 19:30:15zsombJárda-L (40)cpp17Wrong answer 4/401ms508 KiB
#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> DP;
long long d(int k){
    if(k == n)
        return DP[k];
    if(k+3 < n+1)
        DP[k+3] += 2*DP[k];
    if(k+2 < n+2)
        DP[k+2] += DP[k];
    if(k+1 < n+1)
        DP[k+1] += DP[k];
    return d(k+1);
}

int main(){
    cin >> n;
    DP.resize(n+1,0);
    DP[0] = 1;
    cout << d(0);
}
SubtaskSumTestVerdictTimeMemory
base4/40
1Accepted0/01ms508 KiB
2Wrong answer0/01ms316 KiB
3Accepted2/21ms316 KiB
4Accepted2/21ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Wrong answer0/21ms316 KiB
8Wrong answer0/31ms316 KiB
9Wrong answer0/31ms500 KiB
10Wrong answer0/31ms316 KiB
11Wrong answer0/31ms316 KiB
12Wrong answer0/31ms316 KiB
13Runtime error0/31ms416 KiB
14Wrong answer0/31ms384 KiB
15Wrong answer0/31ms320 KiB
16Wrong answer0/31ms508 KiB
17Wrong answer0/31ms316 KiB