6162021-11-04 18:55:06TSomaToronyépítés (1,1,3,3)cpp14Wrong answer 26/502ms1208 KiB
#include <stdio.h>
#include <stdint.h>

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

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

    int_fast32_t a = 2;
    int_fast32_t b = 4;
    int_fast32_t c = 10;
    int_fast32_t d = 24;
    int_fast32_t e = 56;
    int_fast32_t f = 132;

    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);

        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
base26/50
1Accepted0/02ms1160 KiB
2Wrong answer0/02ms1116 KiB
3Accepted3/31ms1204 KiB
4Accepted3/31ms1208 KiB
5Accepted4/41ms1144 KiB
6Accepted4/41ms1144 KiB
7Wrong answer0/42ms1208 KiB
8Wrong answer0/41ms1136 KiB
9Accepted4/41ms1200 KiB
10Accepted4/41ms1080 KiB
11Wrong answer0/41ms1208 KiB
12Wrong answer0/42ms1208 KiB
13Wrong answer0/42ms1144 KiB
14Wrong answer0/41ms1088 KiB
15Accepted2/21ms1208 KiB
16Accepted2/21ms1208 KiB