[20260228] BOJ / G4 / 체스판 다시 칠하기 2 / 이준희#1979
Merged
ShinHeeEul merged 1 commit intomainfrom Feb 28, 2026
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/25682
🧭 풀이 시간
60분
👀 체감 난이도
✏️ 문제 설명
N X M 으로 그려져 있는 체스판이 있습니다.
이 체스판은 정상적으로 그려져 있지 않은 경우가 있어서 체스판 모양대로 격자로 흰,검 으로 다시 칠해야 합니다.
이 때 N X M 판을 K X K 만큼 잘라내었을 때 가장 적은 칸을 다시 칠하는 경우를 찾는 문제입니다.
🔍 풀이 방법
전체 N X M의 판을 체스판처럼 다시 칠하는 경우를 누적합을 이용해서 찾았습니다.
이후 K X K의 체스판을 잘라냈을때 왼쪽상단 우측하단 값을 통해서 K X K에서 몇개를 다시 칠해야될지 구할 수 있습니다.
이를 이용해서 K ~ N, M 만큼 순회하면서 최솟값을 찾았습니다.
⏳ 회고
처음에는 브루트포스로 했다가 시간초과가 나서 다시 풀었습니다.
문제의 요구조건에 따른 인사이트를 길러야할 필요가 있을 것 같습니다.