|
|
I wrote a program, and I also can't get AC, I have tested 4 days, but still...... I have written to the author, but no reply..... [deleted by moderator] Edited by moderator 11.04.2004 01:53 > > [deleted by moderator] Edited by moderator 11.04.2004 01:53 Because the judger use something like "fc" in dos, to compare your output and right output directly....... I tried to change "for u:=1 to n do" to "for u:=n downto 1 do", and a ACed program get WA....... So you'd better ask a ACed person for program.......... I got accepted, but I'm sure there exists a test, which my solution will fail to solve. My solution is nothing but hungarian algo ( bipartite version ), but it passes the tests because of some greedies assisting with it. It would be nice to code the real algo some day ( it seems pretty sophisticated :). pesho > I got accepted, but I'm sure there exists a test, which my solution > will fail to solve. My solution is nothing but hungarian algo ( > bipartite version ), but it passes the tests because of some greedies > assisting with it. It would be nice to code the real algo some day ( > it seems pretty sophisticated :). > > pesho [deleted by moderator] Edited by moderator 11.04.2004 01:52 [deleted by moderator] Edited by moderator 11.04.2004 01:52 This is general graph matching, and you cannot find augmenting path in such way, that you use in bipartite graph matching. Is there an algorithm of time complexity less than O(n^4)? Edmond's blossom algorithm with adjacency matrix of time complexity O(n^4) gets TLE. There are two equal numbers in a line, but this should not appear according to the problem. I've used the algorithm for bipartite graph to this problem,and it got WA.So i refer to some graph theory book,it says that we must handle blossoms,but it did not say why this!From my test data the bipartite graph algorithm works fine!Can anybody explain this to me?Or give out some counter examples that the bipartite graph algorithm fails... I asked about this problem. There are some "flowers" things that make the bipartite algorithm to fail. IT's based on a true theorem, but the DFS fails. However, I do the following thing - DFS, but observse the edges in random way, not for(i=1;i<=n;i++) and things like that but a permutation. Damn, i think my English is not good :))) I have generated case(not randomly) where your solution fails. But it is not uploaded, expect rejudge. I've used the algorithm for bipartite graph to this problem,and it got WA.So i refer to some graph theory book,it says that we must handle blossoms,but it did not say why this!From my test data the bipartite graph algorithm works fine!Can anybody explain this to me?Or give out some counter examples that the bipartite graph algorithm fails... |
|
|