5512021-11-03 20:20:37TSomaToronyépítés (1,1,3,3)cpp11Wrong answer 30/502ms1972 KiB
#include <iostream>

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

    int N;
    std::cin >> N;
    N -= 3;

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


    while (N>0)
    {
        a = 2 * (c + a);
        b = 2 * (a + b);
        c = 2 * (b + c);

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

        N -= 3;
    }

    
    switch (N % 3)
    {
    case 0:
        std::cout << c % 20210108;
        break;
    case -1:
        std::cout << a % 20210108;
        break;
    case -2:
        std::cout << b % 20210108;
        break;
    }
}
SubtaskSumTestVerdictTimeMemory
base30/50
1Wrong answer0/02ms1880 KiB
2Wrong answer0/01ms1912 KiB
3Wrong answer0/31ms1968 KiB
4Wrong answer0/31ms1972 KiB
5Accepted4/41ms1968 KiB
6Wrong answer0/41ms1972 KiB
7Accepted4/42ms1972 KiB
8Accepted4/41ms1964 KiB
9Wrong answer0/41ms1968 KiB
10Wrong answer0/41ms1972 KiB
11Accepted4/41ms1964 KiB
12Accepted4/42ms1968 KiB
13Accepted4/42ms1972 KiB
14Accepted4/42ms1964 KiB
15Accepted2/21ms1964 KiB
16Wrong answer0/21ms1972 KiB