5572021-11-03 20:29:55SzankaBenedekToronyépítés (1,1,3,3)cpp11Accepted 50/502ms1208 KiB
#include <stdio.h>

int main()
{
    int N;
    scanf("%d\n", &N);

    unsigned long long int a = 2;
    unsigned long long int b = 4;
    unsigned long long int c = 10;
    for (; N > 3; N -= 3)
    {
        a = 2 * (c + a);
        b = 2 * (a + b);
        c = 2 * (b + c);
        if (c >= 2021010800000)
        {
            c %= 20210108;
            if (b >= 2021010800000)
            {
                b %= 20210108;
                if (a >= 2021010800000)
                    a %= 20210108;
            }
        }
    }
    switch (N)
    {
    case 3:
        printf("%d\n", c % 20210108);
        break;
    case 1:
        printf("%d\n", a % 20210108);
        break;
    case 2:
        printf("%d\n", b % 20210108);
        break;
    }
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/01ms1092 KiB
2Accepted0/01ms1184 KiB
3Accepted3/31ms1208 KiB
4Accepted3/31ms1144 KiB
5Accepted4/41ms1140 KiB
6Accepted4/41ms1204 KiB
7Accepted4/42ms1144 KiB
8Accepted4/41ms1140 KiB
9Accepted4/41ms1204 KiB
10Accepted4/41ms1140 KiB
11Accepted4/41ms1140 KiB
12Accepted4/42ms1144 KiB
13Accepted4/42ms1136 KiB
14Accepted4/41ms1140 KiB
15Accepted2/21ms1140 KiB
16Accepted2/21ms1144 KiB