51282023-04-19 19:23:53anonJárdakövezés háromféle elemmelcpp17Wrong answer 0/303ms2892 KiB
#include <cstdio>

#define N 5

int main()
{
    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/02ms1224 KiB
2Accepted0/02ms1448 KiB
3Wrong answer0/23ms1664 KiB
4Wrong answer0/22ms1872 KiB
5Wrong answer0/23ms2160 KiB
6Wrong answer0/22ms2132 KiB
7Wrong answer0/22ms2288 KiB
8Wrong answer0/22ms2440 KiB
9Wrong answer0/22ms2492 KiB
10Wrong answer0/22ms2716 KiB
11Wrong answer0/22ms2628 KiB
12Wrong answer0/32ms2708 KiB
13Wrong answer0/32ms2704 KiB
14Wrong answer0/32ms2756 KiB
15Wrong answer0/32ms2892 KiB