vali's blog

By vali, history, 19 months ago, In English

I'm attempting to solve 894E - Ralph and Mushrooms but unfortunately getting WA on TC5, I think my approach is right, can I please get a hint as to why I might be getting a WA? Appreciated. My submission: 303151391

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

»
19 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

have you considered the possibility that ans may be overflowing?

  • »
    »
    19 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    I always use long long int, so I dont think that should be the issue :/

    • »
      »
      »
      19 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      Okay, so I actually took a look at your code and noticed this:

      edges[{a,b}] = weight;

      The statement says:

      There can be paths that lead from a tree to itself, and multiple paths between the same pair of trees.

      You overwrite cases with multiple paths.

»
19 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

This was the hardest question of a div. 2 contest 7 years ago?? O.o

Damn, you can see how much the meta has changed... guess I was born too late to be a master :'(