ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1237. Evacuation Plan

Any tips on solving this problem?
Posted by Sap 19 May 2010 21:40
hi,

im trying to solve this problem and would like to get tips in the right direction of solving this problem.

would a grapha matching solution work? or perhaps a minimum cost flow solution? or anything else?

thanks in advance.
Re: Any tips on solving this problem?
Posted by SkorKNURE 6 Oct 2010 15:12
My solution is to find really optimal matching with min-cost max-flow. Then compare it to one from input.
Re: Any tips on solving this problem?
Posted by Tolstobrov Anatoliy[Ivanovo SPU] 4 May 2017 04:08
I solved it with negative cycle searching.

My algo have following complexity: (N+M)*(2*N*M + M*M)
Re: Any tips on solving this problem?
Posted by Harkonnen 14 Aug 2022 22:22
It can also be a chain ending up in shelter with residue capacity.

It is also possible to make it N*M*M + M*M*M by jumping from shelter to shelter through one preselected building which grants maximum yield for that pair of shelters (hence the first N*M*M step), M*M*M is Bellman-Ford.