227392026-01-15 17:36:36algoproJárdakövezés háromféle elemmelcpp17Wrong answer 0/303ms1268 KiB
// UUID: 60332faa-cb33-4c84-b21a-4963da83af0f
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using pii=pair<int,int>;

int main() {
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	int n; cin >> n;
	/*if(n==2)
	{
		cout << 11;
		return 0;
	}*/
	vector<int> sarok(n+1), teljes(n+1);
	teljes[0]=1;
	sarok[1]=1;
	teljes[1]=2;
	for(int i=2; i<=n; i++)
	{
		sarok[i]=(sarok[i-1]+teljes[i-1]+teljes[i-2]*2)%2023;
		teljes[i]=(sarok[i]+sarok[i-1]*2+teljes[i-1]*2)%2023;
	}
	cout << teljes[n];
}
SubtaskSumTestVerdictTimeMemory
base0/30
1Accepted0/01ms316 KiB
2Wrong answer0/01ms316 KiB
3Wrong answer0/21ms316 KiB
4Wrong answer0/21ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Wrong answer0/21ms508 KiB
8Wrong answer0/21ms316 KiB
9Wrong answer0/21ms564 KiB
10Wrong answer0/21ms564 KiB
11Wrong answer0/23ms836 KiB
12Wrong answer0/33ms1096 KiB
13Wrong answer0/31ms316 KiB
14Wrong answer0/31ms316 KiB
15Wrong answer0/33ms1268 KiB