Skip to content

Commit

Permalink
Merge pull request #28 from AlgoLeadMe/6-fnzksxl
Browse files Browse the repository at this point in the history
6-fnzksxl
  • Loading branch information
fnzksxl authored Feb 18, 2024
2 parents 20bc426 + f7d84ee commit 838c5c6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions fnzksxl/DP/등굣길.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
def solution(m, n, puddles):
dp = [[0 for i_ in range(m+1)] for j in range(n+1)]

dp[0][1] = 1

for puddle in puddles:
a,b = puddle
dp[b][a] = -1

for j in range(1,m+1):
for i in range(1,n+1):
if dp[i][j] == -1:
continue
elif dp[i-1][j] == -1:
dp[i][j] = dp[i][j-1]
elif dp[i][j-1] == -1:
dp[i][j] = dp[i-1][j]
else:
dp[i][j] = (dp[i-1][j] + dp[i][j-1])

return dp[n][m]%1000000007
1 change: 1 addition & 0 deletions fnzksxl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
| 3차시 | 2024-01-24 | 그리디 | [소트](https://www.acmicpc.net/problem/1083) | [#15](https://github.com/AlgoLeadMe/AlgoLeadMe-6/pull/15) |
| 4차시 | 2024-01-31 | 그리디 | [요격 시스템](https://school.programmers.co.kr/learn/courses/30/lessons/181188) | [#19](https://github.com/AlgoLeadMe/AlgoLeadMe-6/pull/19) |
| 5차시 | 2024-02-06 | 다익스트라 | [최소비용 구하기 2](https://www.acmicpc.net/problem/11779) | [#21](https://github.com/AlgoLeadMe/AlgoLeadMe-6/pull/21) |
| 6차시 | 2024-02-14 | DP | [등굣길](https://school.programmers.co.kr/learn/courses/30/lessons/42898) | [#28](https://github.com/AlgoLeadMe/AlgoLeadMe-6/pull/28)
---

0 comments on commit 838c5c6

Please sign in to comment.