Skip to content

Conversation

@LiiNi-coder
Copy link
Contributor

🧷 문제 링크

https://school.programmers.co.kr/learn/courses/30/lessons/12945

🧭 풀이 시간

10 분

👀 체감 난이도

✏️ 문제 설명

  • 피보나치 수 구하기

🔍 풀이 방법

  • 하향식dp

⏳ 회고

  • 프로젝트, 필기 등이 바빠서 한동안 꿀빨겠습니다 죄송하빈다...

@LiiNi-coder LiiNi-coder added the success 👍 해설을 보지 않고 풀었을 때 label Oct 24, 2025
@ShinHeeEul ShinHeeEul merged commit 530811b into main Oct 24, 2025
1 check passed
@LiiNi-coder
Copy link
Contributor Author

틀렸다고 나와서 급히 다시 풀었습니다

class Solution {
    private static int[] dp = new int[100_001];
    public int solution(int n) {
        dp[1] = 1;
        return pibo(n) % 1234567;
    }
    public static int pibo(int n){
        if(n == 1)
            return 1;
        if(n== 0)
            return 0;
        if(dp[n] != 0)
            return dp[n];
        if(dp[n-1] == 0)
            dp[n-1] = pibo(n-1) % 1234567;
        if(dp[n-2] == 0) 
            dp[n-2] = pibo(n-2) % 1234567;
        dp[n] = dp[n-1] + dp[n-2];
        return dp[n];
    }
}

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

Labels

success 👍 해설을 보지 않고 풀었을 때

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants