← All problemsSign in

Grid Coloring I

CSESIntroductory ProblemsOpen on judge ↗

You are given an n\times m grid where each cell contains one character A, B, C or D. For each cell, you must change the character to A, B, C or D. The new character must be different from the old one. Your task is to change the characters in every cell such that no two adjacent cells have the same character. Input The first line has two integers n and m: the number of rows and columns. The ne

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start