← All problemsSign in

Function Function

CodeChefRating 2680Open on judge ↗

Consider a bijective function $ƒ$ $$ f: {1, 2, 3, \dots, n} \rightarrow {1, 2, 3, \dots, n} $$ We have $M$ different color. We have to associate a color to every $x \in {1, 2, 3, ... n}$ with one of the color such that $x$ and$ƒ(ƒ(x))$ has same color . Let G be an array, where G[x] = pair(ƒ[x], color[x]). Find the number of distinct arrays G modulo 1000000007. Input Format: First and the only

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