determinism's blog

By determinism, 10 years ago, In English

I implemented the solution of Jzzhu and Cities as it's told in the tutorial, but I've got WA on test 5. What's my mistake?

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

»
10 years ago, # |
  Vote: I like it +3 Vote: I do not like it

You should subtract degree[v] only if d[v] equals w.

if(d[v] == w)
    degree[v]--;