Weird RE verdict on SEERC 2011 Problem B

Revision en1, by xuanquang1999, 2017-09-11 20:33:15

I'm trying to solve B — Safety Grade from SEERC 2011. My solution is to iterate over all the pair of vertices in the graph (let's call the pair (s, t)), calculate the maximum flow (using Edmond-Karp algorithm) from s to t, and the answer is the minimum value among these max flow value. Also, notice that the answer can't exceed the minimum of each vertex's degree (which won't exceed ), so each maximum flow calculation will be done in less than BFS. So, the overall complexity of the algorithm is O(n * m2).

I don't know why my solution got Runtime Error (that's the last verdict I would expect to get in this problem). I ran stress-testing for half an hour, but couldn't find any wrong test case. I need help finding what's wrong with my implementation. Thanks in advance.

Tags seerc-2011, help needed


  Rev. Lang. By When Δ Comment
en1 English xuanquang1999 2017-09-11 20:33:15 1002 Initial revision (published)