Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
kamyu104 committed Dec 17, 2023
1 parent 8bb3c76 commit ba5561e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Final Round/programming_paths_part_2.py3
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ def precompute():
new_q = []
for A, B in q:
new_q.append((A, B))
for cnt in range(1, len(depths[d])+1):
new_A_B = op(A, B, d%2, cnt%2)
for p in range(1, min(len(depths[d]), 2)+1):
new_A_B = op(A, B, d%2, p%2)
if not (0 <= new_A_B[0] <= MAX_K and 0 <= new_A_B[1] <= MAX_K and new_A_B not in dp):
continue
dp[new_A_B] = (depths[d][:cnt], (A, B))
dp[new_A_B] = (depths[d][:p], (A, B))
new_q.append(new_A_B)
q = new_q
return dp
Expand Down

0 comments on commit ba5561e

Please sign in to comment.