35682023-03-01 08:20:231478Járdakövezés háromféle elemmelcpp17Wrong answer 4/303ms5544 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    //ifstream cin("in.txt");
    int n;
    cin >> n;
    vector<int> e(n + 1);
    vector<int> he(n + 1);
    e[0] = 1;
    e[1] = 2;
    he[0] = 0;
    he[1] = 2;

    for(int i = 2; i <= n; i++){
        e[i] = 2 * e[i - 1] + 3 * e[i - 2] + 2 * he[i - 1];
        he[i] = he[i - 1] + 2 * e[i - 2] + 2 * e[i - 1];
    }

    cout << e[n];



    return 0;
}
SubtaskSumTestVerdictTimeMemory
base4/30
1Accepted0/03ms1816 KiB
2Accepted0/03ms2008 KiB
3Accepted2/23ms2220 KiB
4Accepted2/23ms2576 KiB
5Wrong answer0/23ms2648 KiB
6Wrong answer0/23ms2860 KiB
7Wrong answer0/23ms3080 KiB
8Wrong answer0/23ms3288 KiB
9Wrong answer0/23ms4008 KiB
10Wrong answer0/23ms3980 KiB
11Wrong answer0/23ms4500 KiB
12Wrong answer0/33ms4680 KiB
13Wrong answer0/33ms3920 KiB
14Wrong answer0/33ms4344 KiB
15Wrong answer0/33ms5544 KiB