5602021-11-03 20:31:10TSomaToronyépítés (1,1,3,3)cpp11Wrong answer 41/502ms1220 KiB
#include <stdio.h>

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

    unsigned long long int a = 2;
    unsigned long long int b = 4;
    unsigned long long int c = 10;


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

        if (c >= 10105054000000000) {
            a %= 20210108;
            b %= 20210108;
            c %= 20210108;
        }

        N -= 3;
    }

    
    switch (N % 3)
    {
    case 0:
        printf("%d\n", c % 20210108);
        break;
    case -1:
        printf("%d\n", b % 20210108);
        break;
    case -2:
        printf("%d\n", b % 20210108);
        break;
    }
}
SubtaskSumTestVerdictTimeMemory
base41/50
1Accepted0/02ms1220 KiB
2Accepted0/01ms1188 KiB
3Wrong answer0/31ms1208 KiB
4Accepted3/31ms1148 KiB
5Accepted4/41ms1212 KiB
6Accepted4/41ms1212 KiB
7Accepted4/42ms1208 KiB
8Accepted4/41ms1080 KiB
9Accepted4/41ms1144 KiB
10Wrong answer0/41ms1108 KiB
11Accepted4/41ms1144 KiB
12Accepted4/42ms1208 KiB
13Accepted4/42ms1084 KiB
14Accepted4/41ms1144 KiB
15Accepted2/21ms1208 KiB
16Wrong answer0/21ms1084 KiB