51292023-04-19 19:26:15anonJárdakövezés háromféle elemmelcpp17Wrong answer 0/303ms3608 KiB
#include <cstdio>
#include <iostream>

#define N 5

int main()
{
    std::ios::sync_with_stdio(false);

    int i, a[N + 1], b[N + 1];

    a[0] = b[0] = b[1] = 1;
    a[1] = 2;

    for(i = 2; i <= N; i++)
    {
        a[i] = 2 * a[i - 1] + 3 * a[i - 2] + 4 * b[i - 1];
        b[i] = a[i - 1] + a[i - 2] + b[i - 1];
    }

    printf("%d\n", a[N]);

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/30
1Wrong answer0/03ms1776 KiB
2Accepted0/03ms1992 KiB
3Wrong answer0/23ms2220 KiB
4Wrong answer0/23ms2544 KiB
5Wrong answer0/22ms2640 KiB
6Wrong answer0/23ms2824 KiB
7Wrong answer0/22ms2724 KiB
8Wrong answer0/23ms2776 KiB
9Wrong answer0/23ms2984 KiB
10Wrong answer0/22ms3236 KiB
11Wrong answer0/23ms3264 KiB
12Wrong answer0/33ms3352 KiB
13Wrong answer0/32ms3296 KiB
14Wrong answer0/33ms3548 KiB
15Wrong answer0/32ms3608 KiB