Skip to content

Create BackJoon2579.java#42

Open
syslians wants to merge 1 commit into
mainfrom
백준계단오르기

Hidden character warning

The head ref may contain hidden characters: "\ubc31\uc900\uacc4\ub2e8\uc624\ub974\uae30"
Open

Create BackJoon2579.java#42
syslians wants to merge 1 commit into
mainfrom
백준계단오르기

Conversation

@syslians

Copy link
Copy Markdown
Owner

점화식 유도
dp[i] = i번째 계단까지 올라섰을 때 얻을 수 있는 최대 점수

  1. 마지막 계단(i)은 반드시 밟아야 한다.

  2. 두 가지 경우가 있음: i-2 → i (한 칸 건너뛰고 오름) dp[i-2] + score[i]

    i-3 → i-1 → i (중간에 한 계단을 밟음, 3연속 방지)
    dp[i-3] + score[i-1] + score[i]

점화식 유도
dp[i] = i번째 계단까지 올라섰을 때 얻을 수 있는 최대 점수
1. 마지막 계단(i)은 반드시 밟아야 한다.
2. 두 가지 경우가 있음:
    i-2 → i (한 칸 건너뛰고 오름)
    dp[i-2] + score[i]

    i-3 → i-1 → i (중간에 한 계단을 밟음, 3연속 방지)
    dp[i-3] + score[i-1] + score[i]

@yu-heejin yu-heejin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

잘보고 갑니다!

Comment thread KHJ_Root/백준문제/BackJoon2579.java Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

중요한건 아니지만 BufferedReader를 사용하면 조금 더 빠릅니다!

@Swacker3927 Swacker3927 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@lyg9088

lyg9088 commented Aug 17, 2025

Copy link
Copy Markdown
Collaborator

잘 봤습니다~!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants