234892026-01-23 19:10:12matemakaiJárda-L (40)cpp17Wrong answer 6/401ms508 KiB
#include <bits/stdc++.h>
using namespace std;

struct State {
	long long split = 0, full = 0;
};

int main() {
	int n;
	cin >> n;
	vector<State> dp(n + 1);

	dp[0].full = 1;

	for (int i = 1; i < n + 1; ++i) {
		dp[i].full += dp[i - 1].full;
		dp[i].split += dp[i - 1].split;
		dp[i].full += dp[i - 1].split;
		if (i >= 2) {
			dp[i].full += dp[i - 2].full;
			dp[i].split += dp[i - 2].split;
			dp[i].split += dp[i - 2].full * 2; 
		}
	}

	cout << dp[n].full << endl;
}
SubtaskSumTestVerdictTimeMemory
base6/40
1Accepted0/01ms508 KiB
2Wrong answer0/01ms316 KiB
3Accepted2/21ms316 KiB
4Accepted2/21ms500 KiB
5Accepted2/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Wrong answer0/21ms332 KiB
8Wrong answer0/31ms316 KiB
9Wrong answer0/31ms316 KiB
10Wrong answer0/31ms316 KiB
11Wrong answer0/31ms316 KiB
12Wrong answer0/31ms316 KiB
13Wrong answer0/31ms316 KiB
14Wrong answer0/31ms316 KiB
15Wrong answer0/31ms316 KiB
16Wrong answer0/31ms316 KiB
17Wrong answer0/31ms316 KiB