51332023-04-19 19:31:59anonJárdakövezés háromféle elemmelcpp17Wrong answer 12/304ms6804 KiB
#include <cstdio>
#include <iostream>

using ll = long long;

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

    ll N;
    std::cin >> N;

    ll 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("%lld\n", a[N] % 2023);

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base12/30
1Accepted0/03ms1764 KiB
2Accepted0/03ms1992 KiB
3Accepted2/23ms2352 KiB
4Accepted2/23ms2428 KiB
5Accepted2/23ms2520 KiB
6Accepted2/23ms2640 KiB
7Accepted2/23ms2712 KiB
8Accepted2/23ms2936 KiB
9Wrong answer0/23ms3756 KiB
10Wrong answer0/23ms3956 KiB
11Wrong answer0/23ms5132 KiB
12Wrong answer0/34ms5780 KiB
13Wrong answer0/33ms3684 KiB
14Wrong answer0/33ms4068 KiB
15Wrong answer0/34ms6804 KiB