Make the world a better place
CodeChefOpen on judge ↗
In a particular region, there are $N$ cities in which only criminals live. All the cities are connected to each other such that there is only one path to go from one city to another city. Each city has $P_i$ $(>1)$ population, a rating $R_i$ $(1 \le R_i \leq P_i)$ and a Divine number $D_i$. In each city there is a temple where there are $P_i$ number of pillars (equal to population of the city) whi
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