The X regional school team programming contest will be held in Saratov on Tuesday, 18 of October. The jury has prepared a set of interesting problems. We came to conclusion that it will be unfair if these tasks are available only for the onsite school teams. That's why we decided to organize a contest with these tasks on Codeforces.
The contest was prepared by members of the best teams of the Saratov State University: Gerald Agapov, Polina Bondarenko, Ivan Fefer, Artem Rakhov, Nickolay Kuznetsov, Edvard Davtyan, Pavel Kholkin and Igor Kudryashov, as well as by our "veterans": Natalia Bondarenko, Michael Mirzayanov and me, Dmitry Matov. Maria Belova also did an excellent job and translated the statements into English.
Enjoy the contest!
The statements will be available as PDF via links:
It will be file input-output in these problems. Read statements carefully.
Am I missing something here?
Edit. Ok I see: "allowed not" not "not allowed"...
Thanks, for the clarification.
You forgot to initialize a before reading edges.
for (int i = 0; i < a[u].size(); i++)