Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

Maxflow problem

Revision en1, by noobinho, 2018-08-15 20:40:11

I'm trying to solve this problem: http://acm.timus.ru/problem.aspx?space=1&num=1421. I created a graph in which the source vertex is 0 and the sink vertex is 2n + 1. Vertices from 1 to n are the banks and vertices from n+1 to 2n are the enterprises. After the necessary connections have been made, I ran the O(V³) algorithm to find the maxflow of the graph and construct the demanded matrix A. I stored the sum of the lines of the matrix in the array r and the sum of the columns in the array col. If some of those sums are different from some of the elements in the arrays sr or sc or if some element of the matrix A is negative it prints "NO". It gives WA#19. Code: https://ideone.com/i9l3zW. Someone could help me, please?


  Rev. Lang. By When Δ Comment
en1 English noobinho 2018-08-15 20:40:11 748 Initial revision (published)