51302023-04-19 19:27:18anonJárdakövezés háromféle elemmelcpp17Wrong answer 4/303ms4088 KiB
#include <cstdio>

int main()
{
int N; scanf("%d", &N);
    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
base4/30
1Accepted0/03ms1252 KiB
2Accepted0/03ms1608 KiB
3Accepted2/23ms1800 KiB
4Accepted2/23ms1920 KiB
5Wrong answer0/23ms2320 KiB
6Wrong answer0/22ms2212 KiB
7Wrong answer0/22ms2244 KiB
8Wrong answer0/22ms2192 KiB
9Wrong answer0/23ms2828 KiB
10Wrong answer0/23ms2820 KiB
11Wrong answer0/23ms3480 KiB
12Wrong answer0/33ms3636 KiB
13Wrong answer0/33ms2596 KiB
14Wrong answer0/33ms2664 KiB
15Wrong answer0/33ms4088 KiB