14912022-11-20 16:40:401478Járda-L (40)cpp11Wrong answer 2/403ms3784 KiB
#include <bits/stdc++.h>
#include <complex>
#include <queue>
#include <set>
#include <unordered_set>
#include <list>
#include <chrono>
#include <random>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <stack>
#include <iomanip>
#include <fstream>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> p32;
typedef pair<ll, ll> p64;
typedef pair<double, double> pdd;
typedef vector<ll> v64;
typedef vector<int> v32;
typedef vector<vector<int>> vv32;
typedef vector<vector<ll>> vv64;
typedef vector<vector<p64>> vvp64;
typedef vector<p64> vp64;
typedef vector<p32> vp32;
ll MOD = 998244353;
double eps = 1e-12;
#define forn(i, e) for (ll i = 0; i < e; i++)
#define forsn(i, s, e) for (ll i = s; i < e; i++)
#define rforn(i, s) for (ll i = s; i >= 0; i--)
#define rforsn(i, s, e) for (ll i = s; i >= e; i--)
#define ln "\n"
#define dbg(x) cout << #x << " = " << x << ln
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define INF 2e18
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())

int main()
{
    // ifstream cin("be.txt");
    int n;;
    cin >> n;
    vector<int> f(n + 1), g(n + 1);
    f[0] = 1;
    f[1] = 1;
    g[1] = 1;
    for (int i = 2; i <= n; i++)
    {
        f[i] = f[i - 1] + f[i - 2] + 2 * g[i - 2];
        g[i] = f[i - 1] + g[i - 1];
        cout<<f[i]<<" ";
    }
    cout << f[n];

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base2/40
1Wrong answer0/03ms1816 KiB
2Wrong answer0/02ms2004 KiB
3Accepted2/22ms2208 KiB
4Wrong answer0/22ms2308 KiB
5Wrong answer0/22ms2532 KiB
6Wrong answer0/22ms2636 KiB
7Wrong answer0/22ms2752 KiB
8Wrong answer0/32ms2964 KiB
9Wrong answer0/32ms3040 KiB
10Wrong answer0/32ms3036 KiB
11Wrong answer0/32ms3160 KiB
12Wrong answer0/32ms3516 KiB
13Wrong answer0/32ms3540 KiB
14Wrong answer0/32ms3784 KiB
15Wrong answer0/32ms3736 KiB
16Wrong answer0/32ms3728 KiB
17Wrong answer0/32ms3668 KiB