Skip to content

Commit

Permalink
Update usaco-694.mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
Sosuke23 authored Nov 7, 2024
1 parent 4b49ed4 commit 34f53f6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions solutions/gold/usaco-694.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,17 @@ for i in range(n):
if l == A[i]:
dp[i][j][l] += 1

# switch to not item
dp[i + 1][j + 1][0] = max(dp[i + 1][j + 1][0], dp[i][j][l])

# switch to not item
dp[i + 1][j + 1][1] = max(dp[i + 1][j + 1][1], dp[i][j][l])

# switch to not item
dp[i + 1][j + 1][2] = max(dp[i + 1][j + 1][2], dp[i][j][l])
# switch to not item
dp[i + 1][j][l] = max(dp[i + 1][j][l], dp[i][j][l])

# stay
dp[i + 1][j][l] = max(dp[i + 1][j][l], dp[i][j][l])

res = 0
for i in range(3):
Expand Down

0 comments on commit 34f53f6

Please sign in to comment.