← All problemsSign in

Code Land

Codeland is a big country. It consist of N cities and M roads connecting the cities. The strength of road is defined by a function as : Base Cases: f(1, y) = 1 % MOD f(x, 1) = 1 % MOD f(1, 1) = 0 Function Definition: if x != y : f(x, y) = ( f(x-1, y) + f(x, y-1) + f(x-1, y-1) ) % MOD else : f(x, y) = 0 The rules of codeland are such that whenever a road is added between city x and city y then t

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