suraj021's blog

By suraj021, 11 years ago, In English

I am solving problem Electrification Pan in TimusOJ. My approach was to calculate shortest path between any pair using Floyd warshall algo and then calculate min cost from each vertex to the vertices with power station and add them . But unfortunately it gives WA. My Solution in Ideone. Please point out my mistake :) Thanks UPD: Still I cannot solve this problem( 19/08/2015 )

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

| Write comment?
»
11 years ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

Your idea is wrong because you don't have to pay twice if you use the edge twice.

»
11 years ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

I'll solve this problem on my next stream.