Fullmetal Alchemist
CodeChefOpen on judge ↗
After completing the preliminary tests, Full Metal now faces his final exam. Captain Mustang gives him an n*m grid of letters. He defined distance between two rows of the grid as the largest absolute difference between letters in the same column. Full Metal is assigned to mark all the rows. The cost of marking the first row of his choice is zero. Thereafter the cost of marking each row is equal
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.
Sign in to chat with the tutor and save your progress.
Sign in to start