I've spent like 5+ hours trying to understand the editorial for this problem.
It seem's like the official editorial was not understandable in the first place?
The official editorial and jiangly's ac code is all I found.
Are there any other materials that presents this problem's solution?
things I don't understand
editorial : what does dangerous level even mean? why does this greedy work? (I have no idea)
ac code : what does function "search" do? (probably related to dangerous level?)
Auto comment: topic has been updated by e3e (previous revision, new revision, compare).