60462023-10-28 19:34:04tomi7Toronyépítés (80 pont)cpp11Accepted 80/808ms4128 KiB
// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
	cin>>n;
	long long elozo1=0;
	long long elozo2=1;
	long long valasz=0;
	for(int i=0;i<n;i++){
		valasz=elozo2*3+elozo1;
		valasz%=20210108;
		elozo1=elozo2;
		elozo2=valasz;
	}
	cout<<valasz%20210108<<'\n';
}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/03ms1872 KiB
2Accepted0/03ms2124 KiB
3Accepted4/43ms2332 KiB
4Accepted4/43ms2392 KiB
5Accepted5/53ms2604 KiB
6Accepted5/53ms2856 KiB
7Accepted6/68ms3052 KiB
8Accepted6/63ms3264 KiB
9Accepted7/72ms3480 KiB
10Accepted7/73ms3524 KiB
11Accepted8/84ms3644 KiB
12Accepted8/88ms3772 KiB
13Accepted8/88ms3764 KiB
14Accepted8/84ms4028 KiB
15Accepted2/23ms4128 KiB
16Accepted2/22ms4124 KiB