66072023-12-12 19:17:51horvathabelToronyépítés (2,2,3,3)cpp17Accepted 40/404ms5316 KiB

#include <bits/stdc++.h>
using namespace std;
int mod=20210108; 
int main() {
	vector<int> dp;
	dp.push_back(0);
	dp.push_back(2);
	dp.push_back(2); 
	int n;
	cin>>n;
	for (int i=3; i<n;i++){
		int mst=dp[i-2]*2+dp[i-3]*2;
		mst=mst%mod; 
		dp.push_back(mst);
	}
	n--; 
	cout<<dp[n];
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/03ms1816 KiB
2Accepted0/03ms2016 KiB
3Accepted2/23ms2220 KiB
4Accepted2/23ms2432 KiB
5Accepted3/33ms2512 KiB
6Accepted3/33ms2756 KiB
7Accepted3/34ms4780 KiB
8Accepted3/34ms3936 KiB
9Accepted3/33ms2940 KiB
10Accepted3/33ms2964 KiB
11Accepted3/34ms5064 KiB
12Accepted3/34ms5316 KiB
13Accepted4/44ms5128 KiB
14Accepted4/44ms5308 KiB
15Accepted2/23ms3496 KiB
16Accepted2/23ms3628 KiB