15342022-11-22 12:57:53TomaSajtJárda-L (40)cpp14Wrong answer 0/403ms3468 KiB
#include <bits/stdc++.h>
#define speed ios::sync_with_stdio(0);cin.tie(0)
using namespace std;

int main() {
    speed;
    int n;
    cin >> n;
    vector<int> a(n + 1), b(n + 1);
    a[0] = 1;
    b[0] = 0;
    a[1] = 1;
    b[1] = 2;
    for (int i = 2; i <= n; i++) {
        a[i] = a[i - 2] + a[i - 1] + b[i - 2];
        b[i] = b[i - 1] + 2 * a[i - 1];
    }
    cout << '\n';
    cout << a[n];
}
SubtaskSumTestVerdictTimeMemory
base0/40
1Wrong answer0/03ms1828 KiB
2Wrong answer0/02ms2056 KiB
3Wrong answer0/22ms2256 KiB
4Wrong answer0/22ms2332 KiB
5Wrong answer0/22ms2340 KiB
6Wrong answer0/22ms2460 KiB
7Wrong answer0/22ms2668 KiB
8Wrong answer0/32ms2836 KiB
9Wrong answer0/32ms2912 KiB
10Wrong answer0/32ms3036 KiB
11Wrong answer0/32ms3112 KiB
12Wrong answer0/32ms3112 KiB
13Wrong answer0/32ms3244 KiB
14Wrong answer0/32ms3348 KiB
15Wrong answer0/32ms3468 KiB
16Wrong answer0/32ms3316 KiB
17Wrong answer0/32ms3444 KiB