5132021-11-03 19:01:06Kris030Toronyépítés (1,1,3,3)cpp11Accepted 50/504ms2104 KiB
#include <iostream>

using namespace std;

typedef unsigned long long int ulli;

const ulli MODNUM = 20210108, LMODNUM = MODNUM * 100000;
ulli a = 2, b = 4, c = 10;
int N;

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

	for (int n = 3; n < N; n += 3) {
		a = 2 * (c + a);
		b = 2 * (a + b);
		c = 2 * (b + c);

		a = a >= LMODNUM ? a % LMODNUM : a;
		b = b >= LMODNUM ? b % LMODNUM : b;
		c = c >= LMODNUM ? c % LMODNUM : c;
	}

	switch (N >= 3 ? N % 3 : N) {
		case 0: printf("%d", c % MODNUM); break;
		case 1: printf("%d", a % MODNUM); break;
		case 2: printf("%d", b % MODNUM); break;
	}
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/02ms1948 KiB
2Accepted0/01ms2040 KiB
3Accepted3/31ms2048 KiB
4Accepted3/31ms2040 KiB
5Accepted4/41ms2052 KiB
6Accepted4/41ms2048 KiB
7Accepted4/44ms2052 KiB
8Accepted4/42ms2056 KiB
9Accepted4/41ms2068 KiB
10Accepted4/41ms2080 KiB
11Accepted4/42ms2068 KiB
12Accepted4/44ms2072 KiB
13Accepted4/44ms2084 KiB
14Accepted4/42ms2092 KiB
15Accepted2/21ms2100 KiB
16Accepted2/21ms2104 KiB