5912021-11-03 22:19:17TSomaToronyépítés (1,1,3,3)cpp14Elfogadva 50/503ms1272 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 >= 202101080000) {
            a %= 20210108;
            b %= 20210108;
            c %= 20210108;
            d %= 20210108;
            e %= 20210108;
            f %= 20210108;
            g %= 20210108;
            h %= 20210108;
            i %= 20210108;
            j %= 20210108;
            k %= 20210108;
            l %= 20210108;
        }

        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;
    }
}
RészfeladatÖsszpontTesztVerdiktIdőMemória
base50/50
1Elfogadva0/02ms1160 KiB
2Elfogadva0/01ms1272 KiB
3Elfogadva3/31ms1076 KiB
4Elfogadva3/31ms1144 KiB
5Elfogadva4/41ms1204 KiB
6Elfogadva4/41ms1208 KiB
7Elfogadva4/42ms1208 KiB
8Elfogadva4/41ms1076 KiB
9Elfogadva4/41ms1144 KiB
10Elfogadva4/41ms1144 KiB
11Elfogadva4/41ms1204 KiB
12Elfogadva4/43ms1140 KiB
13Elfogadva4/42ms1144 KiB
14Elfogadva4/41ms1076 KiB
15Elfogadva2/21ms1144 KiB
16Elfogadva2/21ms1080 KiB