l-.-l's blog

By l-.-l, 14 years ago, In English

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!

Full text and comments »

  • Vote: I like it
  • +3
  • Vote: I do not like it

By l-.-l, 14 years ago, In English

Hello, I was trying to solve the problem http://uva.onlinejudge.org/external/109/10913.html but i think that it has a mistake in the problem description, in according to the rules: - You can move left, right and down - You can step at most K times, and you can not step one cell more than once

For the first case:

n = 4, k = 1
  1    2    3  -5
-10    6    0  -1
-10  -10  -10   2
  0    0    0   1

I think that you can go for the next path: (1,1) -> (1,2) -> (1,3) -> (2,3) -> (2,2) -> (4,2) -> (4,3) -> (4,4) right right down left step_down right right

Getting as a maximum sum path : 1 + 2 + 3 + 0 + 6 + 0 + 0 + 1 = 13 But the sample output is 11.

Please, tell me if i am wrong, i do not sure that i understood the problem because to get 11 as output you can not go left :s

Thanks in advance.

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it