Query on Tree
CodeChefOpen on judge ↗
You will be given a rooted tree consisting of n nodes. All the nodes are numbered from 0 to n-1. Root of the tree is always 0. Each node contains the value of factorial of its node number mod 10 9 +7. For example,if node number is 3, then it will contain 3!=6 mod 10 9 +7 which is equal to 6. You will be given q queries consisting of two space separated integers a and b, both denoting the node nu
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