227042026-01-15 16:56:23algoproJárdakövezés háromféle elemmelcpp17Wrong answer 0/303ms1844 KiB
// UUID: ee8a4c0b-6baa-44f6-82ad-7b23ebdfcc2a
#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]+b[i-1];
	}
	cout << a[n-1];
}
SubtaskSumTestVerdictTimeMemory
base0/30
1Accepted0/01ms508 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/21ms560 KiB
9Wrong answer0/21ms820 KiB
10Wrong answer0/22ms820 KiB
11Wrong answer0/22ms1524 KiB
12Wrong answer0/32ms1588 KiB
13Wrong answer0/31ms316 KiB
14Wrong answer0/31ms564 KiB
15Wrong answer0/33ms1844 KiB