1002021-01-11 22:54:10Babják PéterToronyépítés (2,2,3,3)cpp11Runtime error 34/404ms5012 KiB
#include <bits/stdc++.h>
#define P 20210108
#define ll long long
using namespace std;
int main()
{
	int n;cin>>n;
	long long t[n+1];
	t[1]=0;
	t[2]=2;
	t[3]=2;
	t[4]=4;
	t[5]=8;
	t[6]=12;
	for(int i=7;i<n+1;i++)
	{
		t[i]=(ll)((ll)((ll)(t[i-2]*2)%P)+(ll)((ll)(t[i-3]*2)%P))%P;
	}
	cout<<t[n]<<endl;
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base34/40
1Accepted0/02ms1800 KiB
2Accepted0/01ms1844 KiB
3Accepted2/21ms1892 KiB
4Runtime error0/22ms1888 KiB
5Accepted3/31ms1800 KiB
6Accepted3/31ms1904 KiB
7Accepted3/34ms5012 KiB
8Accepted3/33ms3776 KiB
9Accepted3/31ms1920 KiB
10Accepted3/31ms1924 KiB
11Accepted3/34ms4832 KiB
12Accepted3/34ms4800 KiB
13Accepted4/44ms4584 KiB
14Accepted4/43ms4028 KiB
15Runtime error0/22ms1932 KiB
16Runtime error0/21ms2068 KiB