|
|
I firstly tried to solve it with Ford-Bellman algorithm, but got TL and could not make it pass. Then I found here https://e-maxx.ru/algo/min_cost_flow Levit algorithm, and it passed. 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. My solution is to find really optimal matching with min-cost max-flow. Then compare it to one from input. I solved it with negative cycle searching. My algo have following complexity: (N+M)*(2*N*M + M*M) 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. I always have WA8, can you give me some tips about this test? I suppose there is a mistake in the word 'there'. I believe, it must be 'three' "Each line contains there integer numbers Xi, Yi, and Bi" Hi, could you please tell me what was the response of my program to the first test since it gives me a "Wrong Answer"? Could you verify test #1 and my output for this test? I stressed my solution with earlier one (AC solution) and have not found any bad test or mistake. Also i tested my solution on sample test from statement. May be it connected with difference of compiler i use and your compiler. The 1st test is a 1st sample test. Your last solution gives the following incorrect answer on it: SUBOPTIMAL 0 0 0 0 0 0 6 0 0 0 0 0 Edited by author 18.11.2009 14:05 I have tested it again. Result is as in the statement. Could you place somewhere you compiler.. I can't find it for free. Edited by author 18.11.2009 14:22 Edited by author 18.11.2009 14:22 Why my solution has Stack Overflow on test case #7? Could you admins please just tell me where the overflow happens (on which stack/array)? Or is it an infinite recursion in a function? I get WA5? Whats that test about? In this problem we want to minimize the total time needed for all workers as if they run to the shelters one by one. I think this is illogical as in case of a bombardment all workers will run to the shelters simultaneously. Noone else can run until documents are checked at the destination. I have acc this Pb.It is so interesting. if you acc this ,I want to know your solution. sorry my bad english. (ah , my email :linhduong55@yahoo.com Edited by author 25.10.2006 16:29 What's the difference between that message and "Wrong answer at test N..."? Edited by author 21.03.2005 23:07 Problem with validator was fixed |
|
|