5172021-11-03 19:15:34TSomaToronyépítés (1,1,3,3)cpp11Wrong answer 7/502ms1908 KiB
#include <iostream>

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

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

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

    for (int n = 3; n < N; n += 3)
    {
        a = 2 * (c + a) >= 2021010800000 ? a % 20210108000 : a;
        b = 2 * (a + b) >= 2021010800000 ? b % 20210108000 : b;
        c = 2 * (b + c) >= 2021010800000 ? c % 20210108000 : c;
    }

    switch (N >= 3 ? N % 3 : N)
    {
    case 0:
        std::cout << c % 20210108;
        break;
    case 1:
        std::cout << a % 20210108;
        break;
    case 2:
        std::cout << b % 20210108;
        break;
    }
}
SubtaskSumTestVerdictTimeMemory
base7/50
1Wrong answer0/02ms1832 KiB
2Wrong answer0/01ms1844 KiB
3Wrong answer0/31ms1900 KiB
4Accepted3/31ms1904 KiB
5Wrong answer0/41ms1904 KiB
6Wrong answer0/41ms1904 KiB
7Wrong answer0/41ms1904 KiB
8Wrong answer0/41ms1900 KiB
9Wrong answer0/41ms1904 KiB
10Wrong answer0/41ms1904 KiB
11Wrong answer0/41ms1904 KiB
12Wrong answer0/42ms1908 KiB
13Wrong answer0/41ms1900 KiB
14Wrong answer0/41ms1900 KiB
15Accepted2/21ms1904 KiB
16Accepted2/21ms1904 KiB