5952021-11-03 22:33:16TSomaToronyépítés (1,1,3,3)cpp14Wrong answer 38/502ms1360 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);    

    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;

    if (N >= 510000) {
        switch (N % 6) {
        case 0: a = 7354432; b = 2126788; c = 11380796; break;
        case 1: a = 2126788; b = 11380796; c = 17260348; break;
        case 2: a = 11380796; b = 17260348; c = 18564164; break;
        case 3: a = 17260348; b = 18564164; c = 19469704; break;
        case 4: a = 18564164; b = 19469704; c = 12829780; break;
        case 5: a = 19469704; b = 12829780; c = 2157564; break;
        }
        N -= 85000;
    }
    else
    {
        N -= 6;
    }
    


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

        if (f >= 10105054000000000) {
            d %= 202101080000;
            e %= 202101080000;
            f %= 202101080000;
        }

        N -= 6;
    }


    switch (N % 6) {
        case 0: printf("%d\n", f % 20210108); break;
        case -1: printf("%d\n", e % 20210108); break;
        case -2: printf("%d\n", d % 20210108); break;
        case -3: printf("%d\n", c % 20210108); break;
        case -4: printf("%d\n", b % 20210108); break;
        case -5: printf("%d\n", a % 20210108); break;
    }
}
SubtaskSumTestVerdictTimeMemory
base38/50
1Accepted0/02ms1220 KiB
2Accepted0/01ms1272 KiB
3Accepted3/31ms1248 KiB
4Accepted3/31ms1320 KiB
5Accepted4/41ms1324 KiB
6Accepted4/41ms1264 KiB
7Wrong answer0/42ms1336 KiB
8Accepted4/41ms1272 KiB
9Accepted4/41ms1340 KiB
10Accepted4/41ms1340 KiB
11Accepted4/41ms1348 KiB
12Wrong answer0/42ms1360 KiB
13Wrong answer0/42ms1356 KiB
14Accepted4/41ms1292 KiB
15Accepted2/21ms1284 KiB
16Accepted2/21ms1304 KiB