Hello Everyone. I was trying to solve this problem using Dinic algorithm. Since, I have never used the algorithm before, there are some bugs in my code which I am unable to find. I have spent considerable amount of time trying to debug it. Can anyone please help me in debugging my code?
Link to code : https://repl.it/@NikhilAgrawal/RoastedAdoredOpposites
TIA!
Why use Dinic's?
You can use Orlin's + King-Rao-Tarjan algorithm, which solves it without the logarithmic factor and is very very simple to code in no more than 250 lines of code.
I wanted to practice Dinic's algorithm first but I am stuck. :( Please help if you can.
It seems like you meant
if
here:Oops. Thanks! Now it's working properly.