I have a really simple test-case where I initially failed at:
Test:13 31 5 11 21 22 3
13 31 5 11 21 22 3
AnswerCase #1: no yes no
Case #1: no yes no
Thank you for that one, I missed that edge case
Thanks a bunch! That saved me a lot of trouble.
So far the only approach coming to my mind for this problem is to run a max flow for each team. Can you guys tell me if this is too slow? Thanks.
That's the approach I used and it was fast enough. You probably need a good max-flow algorithm though (I used push-relabel with all the heuristics that were presented in the lecture).
You don't actually need to run a maxflow for every team, with some tricks you can cut it down to log(n) maxflow calls.
Anyone kind enough to share any test cases?I am passing all the given ones, plus the one at the beginning of this thread but I am still struggling with wrong answer in the platform.
Thanks in advance for any help.
Thanks for the suggestion. Helped me to solve the problem.
Another potentially relevant test case:
5 5 6
Think it should beCase #1: yes yes yes
Case #1: yes yes yes