sw1ft's blog

By sw1ft, history, 8 years ago, In English

Hey everyone. I'm trying to solve a problem from one of my country's old national contests: UVa 12319. What I did is to build both graphs, run Floyd-Warshall's on both and then check if it's valid or not. Here's my code (boolean p is to print some debug info).

I'm getting WA as veredict. Any help? Thanks!

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

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

On Line 51, you write

if (g2[i][j] > (g1[i][j] * b + a))

This should be

if (g2[i][j] > (g1[i][j] * a + b))