← All problemsSign in

Burnland

Burnland is a town with M houses numbered 1, 2, ..., M, connected with two way tunnel. Droco is a dragon who wants to set the entire town ablaze. For each house, there is a certain risk factor F[i] for setting that house ablaze. But once a house C is set ablaze, all house that can be reached from C will be set ablaze immediately. The overall risk factor of setting some number of houses ablaze is

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