60452023-10-28 19:33:49IgnácToronyépítés (80 pont)cpp11Accepted 80/808ms3996 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int N;
	cin >> N;
	long long a = 0;
	long long b = 1;
	long long c = 0;
	for(int i = 0; i < N; i++){
		c = (b * 3 + a) % 20210108;
		a = b;
		b = c;
	}

	cout << c;
}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/03ms1876 KiB
2Accepted0/03ms2072 KiB
3Accepted4/43ms2292 KiB
4Accepted4/43ms2372 KiB
5Accepted5/53ms2620 KiB
6Accepted5/53ms2836 KiB
7Accepted6/68ms3052 KiB
8Accepted6/63ms3136 KiB
9Accepted7/73ms3316 KiB
10Accepted7/73ms3444 KiB
11Accepted8/84ms3396 KiB
12Accepted8/88ms3488 KiB
13Accepted8/88ms3556 KiB
14Accepted8/84ms3688 KiB
15Accepted2/23ms3708 KiB
16Accepted2/23ms3996 KiB