4512021-11-03 14:50:46kovacs.peter.18fToronyépítés (1,1,3,3)cpp11Accepted 50/508ms2004 KiB
#include <iostream>

int main() {
	std::cin.sync_with_stdio(false);
	std::cin.tie(nullptr);

	int N;
	std::cin >> N;
	int v[3]{ 0, 1, 0 };
	char c = 1;
	while (N--) {
		c = (c + 1) % 3;
		v[c] = 2 * (v[c] + v[(c + 2) % 3]) % 20210108;
	}
	std::cout << v[c];
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/02ms1888 KiB
2Accepted0/02ms1952 KiB
3Accepted3/31ms1996 KiB
4Accepted3/31ms2004 KiB
5Accepted4/41ms2000 KiB
6Accepted4/41ms2004 KiB
7Accepted4/48ms2000 KiB
8Accepted4/42ms2000 KiB
9Accepted4/41ms1996 KiB
10Accepted4/41ms2000 KiB
11Accepted4/43ms1996 KiB
12Accepted4/48ms1996 KiB
13Accepted4/48ms2000 KiB
14Accepted4/44ms2000 KiB
15Accepted2/21ms2000 KiB
16Accepted2/21ms1996 KiB