Count Special Matrices
Let N ≥ 3 be a fixed positive integer. Further, let A[1..N][1..N] be N × N integer matrix. The y-th element in the x-th row will be denoted as A[x][y]. This matrix is called special if it satisfies the following conditions: - A[x][x] = 0 for 1 ≤ x ≤ N. - A[x][y] = A[y][x] > 0 for 1 ≤ x . - A[x][y] ≤ max(A[x][z], A[z][y]) for 1 ≤ x, y, z ≤ N. - A[x][y] ∈ {1, 2, ..., N − 2} for 1 ≤ x . - For ea
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