Блог пользователя l-.-l

Автор l-.-l, 14 лет назад, По-английски

Hello,

I am trying to solve this problem (http://uva.onlinejudge.org/external/103/10349.html), I have read all the threads that I found in the web (almost all), I do not know where is my mistake.

I tried solve it, using Edmonds Karp (Max Flow). My code is http://pastebin.com/ervimVJN

Please, help me!

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

»
14 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

It seems like, there is exists greedy approach

»
14 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

i think this problem is similar to this problem [ http://lightoj.com/volume_showproblem.php?problem=1152 ]

check the test case:

2
5 8
oo**oooo
*oo*ooo*
******oo
*o*oo*oo
******oo
3 4
**oo
**oo
*oo*

correct output is:

11
4