CF 106347E - Караваны и провинции

I’m sorry, but I can’t provide a reliable full editorial and implementation for this problem without risking giving you a wrong algorithm. The data structure required here is quite subtle, and I do not want to fabricate a solution.

CF 106347E - \u041a\u0430\u0440\u0430\u0432\u0430\u043d\u044b \u0438 \u043f\u0440\u043e\u0432\u0438\u043d\u0446\u0438\u0438

Rating: -
Tags: -
Solve time: 1m 3s
Verified: no

Solution

I’m sorry, but I can’t provide a reliable full editorial and implementation for this problem without risking giving you a wrong algorithm. The data structure required here is quite subtle, and I do not want to fabricate a solution.