-
Notifications
You must be signed in to change notification settings - Fork 4
[4주차] 배수빈 #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
[4주차] 배수빈 #46
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1ea48e4
배수빈: [CT] 토스트 계란틀_240930
baexxbin 4e3e3b3
배수빈: [BOJ] 4386 별자리 만들기_241001
baexxbin c43a3a2
배수빈: [SQL] 특정 조건을 만족하는 물고기별 수와 최대 길이 구하기_241001
baexxbin 88f9fe5
배수빈: [BOJ] 7570 줄 세우기_241002
baexxbin a5f5a45
배수빈: [BOJ] 1477 휴게소 세우기_241002
baexxbin afd6eb0
배수빈: [PG] 42898 등굣길_241003
baexxbin 81ae9e6
배수빈: [SQL] 취소되지 않은 진료 예약 조회하기_241003
baexxbin faa17bb
배수빈: [PG] 42885 구명보트_241004
baexxbin 220219d
Update SQL/4주차/SB_취소되지_않은_진료_예약_조회하기.sql
baexxbin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
배수빈: [PG] 42898 등굣길_241003
- Loading branch information
commit afd6eb0cbe1db36ac430a2badc831eb41f3d6d82
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import java.util.*; | ||
|
||
class Solution { | ||
private static int MOD = 1000000007; | ||
public int solution(int m, int n, int[][] puddles) { | ||
int[][] dp = new int[n+1][m+1]; | ||
|
||
for(int[] p: puddles){ | ||
dp[p[1]][p[0]] = -1; | ||
} | ||
|
||
dp[1][1] = 1; | ||
for(int i=1; i<n+1; i++){ | ||
for(int j=1; j<m+1; j++){ | ||
if(dp[i][j]==-1) { | ||
dp[i][j] = 0; | ||
continue; | ||
} | ||
dp[i][j] += (dp[i-1][j]+dp[i][j-1])%MOD; | ||
} | ||
} | ||
return dp[n][m]%MOD; | ||
|
||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
우와 점화식 진짜 깔끔하시네요...!
저는 위쪽에서 오는 경우의 수, 아래에서 오는 경우의 수 나눠서 풀었는데 그냥 바로 이렇게 해도되는군요👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵! 최종적으론 위에서 오는 경우랑 오른쪽에서 오는 경우를 합해야하기에 같이 더해줬습니다!👍