← All problemsSign in

Jigsaw Puzzle Solving

CodeChefRating 3708Open on judge ↗

Imagine a usual jigsaw puzzle. Let its picture be a completely white rectangle with the width of W pixels and the height of H pixels. The puzzle was splitted into K pieces, then they've got mixed up. Now you want to restore it again. Ideally, you'd like merge these pieces in such a way that they'd form a rectangle W pixels wide and H pixels tall, again. However, it can be very hard. Therefore, e

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