4742021-11-03 17:47:05TSomaToronyépítés (1,1,3,3)cpp11Wrong answer 11/504ms1972 KiB
#include <iostream>

int main()
{
    std::cin.sync_with_stdio(false);
    std::cin.tie(nullptr);

    int N;
    std::cin >> N;

    int a = 2;
    int b = 4;
    int c = 10;
    for (int n = 3; n < N; n += 3)
    {
        a = (2 * c + 2 * a);
        b = (2 * a + 2 * b);
        c = (2 * b + 2 * c);

        if (a > 20210108)
            a %= 20210108;
        if (b > 20210108)
            b %= 20210108;
        if (c > 20210108)
            c %= 20210108;
    }

    switch (N % 3)
    {
    case 0:
        std::cout << c;
    case 1:
        std::cout << a;
    case 2:
        std::cout << b;
    default:
        break;
    }
}
SubtaskSumTestVerdictTimeMemory
base11/50
1Accepted0/02ms1884 KiB
2Accepted0/01ms1904 KiB
3Wrong answer0/31ms1968 KiB
4Accepted3/31ms1972 KiB
5Wrong answer0/41ms1968 KiB
6Accepted4/41ms1968 KiB
7Wrong answer0/44ms1968 KiB
8Wrong answer0/41ms1968 KiB
9Accepted4/41ms1968 KiB
10Wrong answer0/41ms1968 KiB
11Wrong answer0/42ms1968 KiB
12Wrong answer0/44ms1964 KiB
13Wrong answer0/43ms1968 KiB
14Wrong answer0/42ms1968 KiB
15Wrong answer0/21ms1968 KiB
16Wrong answer0/21ms1964 KiB