6292021-11-04 22:38:49kovacs.peter.18fToronyépítés (1,1,3,3)cpp11Accepted 50/504ms1220 KiB
#include <stdio.h>

unsigned int N;
unsigned long long a, b, c;

int main() {
	scanf("%d", &N);
	switch (N % 3) {
	case 0: c = 1; break;
	case 1: b = 1; c = 2; break;
	case 2: a = 1; b = 2; c = 4; break;
	}
	N /= 3;
	while (N--) {
		a = 2 * (c + a);
		b = 2 * (a + b);
		c = 2 * (b + c);
		if (c >= 10105054000000000) {
			c %= 20210108;
			if (b >= 10105054000000000) {
				b %= 20210108;
				if (a >= 10105054000000000)
					a %= 20210108;
			}
		}
	}
	printf("%llu", c % 20210108);
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/02ms1220 KiB
2Accepted0/01ms1192 KiB
3Accepted3/31ms1076 KiB
4Accepted3/31ms1076 KiB
5Accepted4/41ms1080 KiB
6Accepted4/41ms1140 KiB
7Accepted4/44ms1080 KiB
8Accepted4/42ms1076 KiB
9Accepted4/41ms1204 KiB
10Accepted4/41ms1204 KiB
11Accepted4/41ms1144 KiB
12Accepted4/43ms1076 KiB
13Accepted4/43ms1208 KiB
14Accepted4/42ms1204 KiB
15Accepted2/21ms1080 KiB
16Accepted2/21ms1204 KiB