1012021-01-11 23:08:16Babják PéterToronyépítés (2,2,3,3)cpp11Accepted 40/403ms4984 KiB
#include <iostream>
#define P 20210108
#define ll long long
using namespace std;
int main()
{
	ll n;cin>>n;
	ll t[n+8];
	t[0]=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]=(t[i-2]*2+t[i-3]*2)%P;
	}
	cout<<t[n]<<endl;
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/01ms1800 KiB
2Accepted0/01ms1836 KiB
3Accepted2/21ms1784 KiB
4Accepted2/21ms1784 KiB
5Accepted3/31ms1784 KiB
6Accepted3/31ms1888 KiB
7Accepted3/33ms4984 KiB
8Accepted3/32ms3744 KiB
9Accepted3/31ms1784 KiB
10Accepted3/31ms1784 KiB
11Accepted3/33ms4788 KiB
12Accepted3/33ms4752 KiB
13Accepted4/43ms4536 KiB
14Accepted4/42ms3980 KiB
15Accepted2/21ms1892 KiB
16Accepted2/21ms1888 KiB