22722023-01-08 23:02:26kohumarkToronyépítés (2,2,3,3)cpp11Accepted 40/403ms5168 KiB
#include <iostream>
using namespace std;

int main(){
	int n; cin >> n;
	int t[n];
	t[0]=0; t[1]=2; t[2]=2;
	for(int i=3; i<n; i++) t[i]=(t[i-2]*2+t[i-3]*2)%20210108;
	cout << t[n-1];
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/03ms1900 KiB
2Accepted0/02ms2036 KiB
3Accepted2/22ms2272 KiB
4Accepted2/22ms2440 KiB
5Accepted3/32ms2516 KiB
6Accepted3/32ms2648 KiB
7Accepted3/33ms4376 KiB
8Accepted3/33ms4024 KiB
9Accepted3/32ms3236 KiB
10Accepted3/32ms3408 KiB
11Accepted3/33ms5168 KiB
12Accepted3/33ms5060 KiB
13Accepted4/43ms5012 KiB
14Accepted4/43ms4728 KiB
15Accepted2/22ms3688 KiB
16Accepted2/22ms3812 KiB