4962021-11-03 18:27:57TSomaToronyépítés (1,1,3,3)cpp11Wrong answer 18/5020ms1928 KiB
#include <iostream>

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

    unsigned int N;
    std::cin >> N;

    unsigned int a = 2;
    unsigned int b = 4;
    unsigned int c = 10;

    char x = 0;

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

        while (a > 20210108) {
            a -= 20210108;
            x++;
        }
        b -= 20210108 * x;
        c -= 20210108 * x;

        x = 0;
    }

    switch (N >= 3 ? N % 3 : N)
    {
    case 0:
        std::cout << c;
        break;
    case 1:
        std::cout << a;
        break;
    case 2:
        std::cout << b;
        break;
    }
}
SubtaskSumTestVerdictTimeMemory
base18/50
1Accepted0/02ms1820 KiB
2Wrong answer0/01ms1840 KiB
3Accepted3/31ms1904 KiB
4Accepted3/31ms1908 KiB
5Wrong answer0/41ms1900 KiB
6Wrong answer0/41ms1908 KiB
7Wrong answer0/420ms1904 KiB
8Wrong answer0/43ms1904 KiB
9Accepted4/41ms1904 KiB
10Accepted4/41ms1900 KiB
11Wrong answer0/44ms1920 KiB
12Wrong answer0/420ms1928 KiB
13Wrong answer0/418ms1908 KiB
14Wrong answer0/48ms1904 KiB
15Accepted2/21ms1904 KiB
16Accepted2/21ms1904 KiB