5732021-11-03 20:45:45TSomaToronyépítés (1,1,3,3)cpp11Wrong answer 18/502ms1208 KiB
#include <stdio.h>

int main()
{
    int N;
    #pragma warning(suppress : 4996)
    scanf("%d\n", &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 %= 202101080000;
            b %= 202101080000;
            c %= 202101080000;
        }

        N -= 3;
    }

    
    switch (N % 3)
    {
    case 0:
        printf("%d\n", (int)c % 20210108);
        break;
    case -1:
        printf("%d\n", (int)b % 20210108);
        break;
    case -2:
        printf("%d\n", (int)a % 20210108);
        break;
    }
}
SubtaskSumTestVerdictTimeMemory
base18/50
1Accepted0/02ms1124 KiB
2Wrong answer0/01ms1132 KiB
3Accepted3/31ms1144 KiB
4Accepted3/31ms1204 KiB
5Wrong answer0/41ms1140 KiB
6Wrong answer0/41ms1204 KiB
7Wrong answer0/42ms1140 KiB
8Wrong answer0/41ms1208 KiB
9Accepted4/41ms1144 KiB
10Accepted4/41ms1144 KiB
11Wrong answer0/41ms1208 KiB
12Wrong answer0/42ms1208 KiB
13Wrong answer0/42ms1080 KiB
14Wrong answer0/41ms1204 KiB
15Accepted2/21ms1204 KiB
16Accepted2/21ms1208 KiB