Merged
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🧷 문제 링크
https://www.acmicpc.net/problem/1563
🧭 풀이 시간
20분
👀 체감 난이도
✏️ 문제 설명
백준 중학교에서 개근상을 주려고 할 때 개근상의 조건이 특이합니다.
출결사항이 기록되는 출결은 출석, 지각, 결석이고,
개근상을 받을 수 없는 사람은 지각을 두 번 이상 했거나, 결석을 세 번 연속으로 한 사람입니다.
N일의 학기를 마치고 개근상을 수여하려고 할 때
개근상이 가능한 경우의 수를 구하는 문제입니다.
🔍 풀이 방법
DP를 이용해서 풀었습니다.
3차원 dp로 [날짜][지각 횟수][연속 결석 횟수] 로 두고 계산했습니다.
최종적으로 N일 일 때 지각횟수가 2회 미만이면서 연속 결석 일수가 3 미만은 모든 칸의 수를 합하여
정답을 구했습니다.
⏳ 회고
N이 1000으로 그렇게 크지 않았기 때문에 3차원으로 쉽게 풀 수 있었던 것 같습니다.