Skip to content
This repository has been archived by the owner on Oct 29, 2023. It is now read-only.

Commit

Permalink
Create squad14
Browse files Browse the repository at this point in the history
  • Loading branch information
creator0131 authored Oct 8, 2023
1 parent 657c765 commit 3a991bc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions squad14
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

if (memo[i][maxSoFar][remain] != -1) {
return memo[i][maxSoFar][remain];
}

int ans = 0;
for (int num = 1; num <= maxSoFar; num++) {
ans = (ans + dp(i + 1, maxSoFar, remain)) % MOD;
}

for (int num = maxSoFar + 1; num <= m; num++) {
ans = (ans + dp(i + 1, num, remain - 1)) % MOD;
}

0 comments on commit 3a991bc

Please sign in to comment.