← All problemsSign in

Crazy Bishops on Chessboard

CodeChefRating 1351Open on judge ↗

Chef has a matrix of size $N\times N$. There are $N$ [bishops](https://en.wikipedia.org/wiki/Bishop_(chess)) placed on the matrix, in a zig-zag fashion, at the cells $(1, 1), (2, 2), (1, 3), (2, 4), (1, 5), \dots,$ and so on. For example, for $N = 4$, the matrix looks like: Your task is to determine the **minimum** number of moves required to reach a position where each cell $(i, i)$ contains ex

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