227082026-01-15 17:01:14algoproJárdakövezés háromféle elemmelcpp17Wrong answer 0/303ms1844 KiB
// UUID: eb357b87-7ff0-4b96-8f23-57d0c006efbc
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using pll=pair<ll, ll>;

int main() {
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	ll n; cin >> n;
	vector<ll> a(n), b(n);
	a[0]=2;
	a[1]=11;
	b[0]=1;
	b[1]=3;
	for (ll i=2; i<n; i++){
		b[i]=a[i-1]+b[i-1]+a[i-2];
		a[i]=b[i]+a[i-1]+a[i-2]+b[i-1]+a[i-2]+a[i-2]+b[i-1];
	}
	cout << a[n-1];
}
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/21ms316 KiB
8Wrong answer0/21ms316 KiB
9Wrong answer0/22ms820 KiB
10Wrong answer0/22ms1004 KiB
11Wrong answer0/23ms1332 KiB
12Wrong answer0/32ms1588 KiB
13Wrong answer0/31ms316 KiB
14Wrong answer0/31ms564 KiB
15Wrong answer0/32ms1844 KiB