Finish the problem

There was just one thing missing from my logic, I should have saw
that... Well, everything worked out in the end!
This commit is contained in:
Segcolt 2024-10-03 17:21:12 -03:00
parent 6fb30a91f7
commit f758d5659a

View File

@ -87,7 +87,7 @@ int main()
vvl dp(n + 1, vl((n * (n + 1) / 4) + 1, 0));
dp[0][0] = 1;
for (size_t i = 1; i <= n; i++) {
for (size_t i = 1; i < n; i++) {
for (size_t j = 0; j <= (n * (n + 1) / 4); j++) {
dp[i][j] += dp[i - 1][j];
if (j >= i) {
@ -98,5 +98,5 @@ int main()
}
// cout << dp;
cout << dp[n][(n * (n + 1) / 4)] / 2 << '\n';
cout << dp[n - 1][(n * (n + 1) / 4)] << '\n';
}