5892021-11-03 22:18:14TSomaToronyépítés (1,1,3,3)cpp14Wrong answer 26/502ms1248 KiB
#include <stdio.h>

#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")

int main()
{
    int N;
    #pragma warning(suppress : 4996)
    scanf("%d\n", &N);
    N -= 12;

    unsigned long long int a = 2;
    unsigned long long int b = 4;
    unsigned long long int c = 10;
    unsigned long long int d = 24;
    unsigned long long int e = 56;
    unsigned long long int f = 132;
    unsigned long long int g = 312;
    unsigned long long int h = 736;
    unsigned long long int i = 1736;
    unsigned long long int j = 4096;
    unsigned long long int k = 9664;
    unsigned long long int l = 22800;


    while (N > 0)
    {
        a = 2 * (l + j);
        b = 2 * (a + k);
        c = 2 * (b + l);
        d = 2 * (c + a);
        e = 2 * (d + b);
        f = 2 * (e + c);
        g = 2 * (f + d);
        h = 2 * (g + e);
        i = 2 * (h + f);
        j = 2 * (i + g);
        k = 2 * (j + h);
        l = 2 * (k + i);

        if (f >= 101050540000000) {
            a %= 202101080000;
            b %= 202101080000;
            c %= 202101080000;
            d %= 202101080000;
            e %= 202101080000;
            f %= 202101080000;
            g %= 202101080000;
            h %= 202101080000;
            i %= 202101080000;
            j %= 202101080000;
            k %= 202101080000;
            l %= 202101080000;
        }

        N -= 12;
    }

    
    switch (N % 12)
    {
    case 0:
        printf("%d\n", l % 20210108);
        break;
    case -1:
        printf("%d\n", k % 20210108);
        break;
    case -2:
        printf("%d\n", j % 20210108);
        break;
    case -3:
        printf("%d\n", i % 20210108);
        break;
    case -4:
        printf("%d\n", h % 20210108);
        break;
    case -5:
        printf("%d\n", g % 20210108);
        break;
    case -6:
        printf("%d\n", f % 20210108);
        break;
    case -7:
        printf("%d\n", e % 20210108);
        break;
    case -8:
        printf("%d\n", d % 20210108);
        break;
    case -9:
        printf("%d\n", c % 20210108);
        break;
    case -10:
        printf("%d\n", b % 20210108);
        break;
    case -11:
        printf("%d\n", a % 20210108);
        break;
    }
}
SubtaskSumTestVerdictTimeMemory
base26/50
1Accepted0/02ms1220 KiB
2Wrong answer0/01ms1248 KiB
3Accepted3/31ms1208 KiB
4Accepted3/31ms1140 KiB
5Accepted4/41ms1204 KiB
6Accepted4/41ms1208 KiB
7Wrong answer0/42ms1144 KiB
8Wrong answer0/41ms1204 KiB
9Accepted4/41ms1076 KiB
10Accepted4/41ms1080 KiB
11Wrong answer0/41ms1208 KiB
12Wrong answer0/42ms1144 KiB
13Wrong answer0/42ms1208 KiB
14Wrong answer0/42ms1204 KiB
15Accepted2/21ms1144 KiB
16Accepted2/21ms1136 KiB