Skip to content

[PGS] 2016년 - #96

Open
gayo73 wants to merge 1 commit into
mainfrom
gayo-#16
Open

[PGS] 2016년#96
gayo73 wants to merge 1 commit into
mainfrom
gayo-#16

Conversation

@gayo73

@gayo73 gayo73 commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

🍪 문제 이름

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


🍊 문제 정의

input

  • 두 수 a ,b

output

  • 2016년 a월 b일이 무슨 요일인지 리턴

🍑 알고리즘 설계

int[] lastDays = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
        
        int totalDays = 0;
        for(int i=0; i<a-1; i++){
            totalDays += lastDays[i];
        }
        totalDays += b;
        
        switch(totalDays%7){
            case 1 : answer = "FRI"; break;
            case 2 : answer = "SAT"; break;
            case 3 : answer = "SUN"; break;
            case 4 : answer = "MON"; break;
            case 5 : answer = "TUE"; break;
            case 6 : answer = "WED"; break;
            case 0 : answer = "THU";
        }

🥝 최악 수행 시간 복잡도

  • O()

🍰 특이 사항 (Optional)

참고 자료나 추가로 설명하고 싶은 내용을 작성해 주세요.

@gayo73
gayo73 requested review from been12151 and yangyeeeun July 22, 2026 13:17
@gayo73 gayo73 self-assigned this Jul 22, 2026
@gayo73 gayo73 linked an issue Jul 22, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[PGS] 2016년 / level 1

1 participant