4702021-11-03 17:39:07kovacs.peter.18fToronyépítés (1,1,3,3)cpp11Accepted 50/504ms1892 KiB
#include <iostream>

unsigned int N, a, b, c;

int main() {
	std::cin >> N;
	switch (N % 6) {
	case 0: c = 1;
		break;
	case 1: b = 1; c = 2;
		break;
	case 2: a = 1; b = 2; c = 4;
		break;
	case 3: a = 2; b = 4; c = 10;
		break;
	case 4: a = 4; b = 10; c = 24;
		break;
	case 5: a = 10; b = 24; c = 56;
		break;
	}
	N /= 6;
	while (N--) {
		a = 2 * (a + c);
		b = 2 * (b + a);
		c = 2 * (c + b);
		a = 2 * (a + c) % 20210108;
		b = 2 * (b + a) % 20210108;
		c = 2 * (c + b) % 20210108;
	}
	std::cout << c;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/02ms1804 KiB
2Accepted0/01ms1828 KiB
3Accepted3/31ms1888 KiB
4Accepted3/31ms1888 KiB
5Accepted4/41ms1888 KiB
6Accepted4/41ms1888 KiB
7Accepted4/44ms1784 KiB
8Accepted4/41ms1888 KiB
9Accepted4/41ms1888 KiB
10Accepted4/41ms1888 KiB
11Accepted4/42ms1784 KiB
12Accepted4/44ms1888 KiB
13Accepted4/43ms1888 KiB
14Accepted4/42ms1788 KiB
15Accepted2/21ms1892 KiB
16Accepted2/21ms1888 KiB