valiii's blog

By valiii, history, 16 hours 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

»
15 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

have you considered the possibility that ans may be overflowing?

  • »
    »
    12 hours ago, # ^ |
      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 :/

    • »
      »
      »
      11 hours ago, # ^ |
        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.

      • »
        »
        »
        »
        11 hours ago, # ^ |
          Vote: I like it +5 Vote: I do not like it

        That might be the problem, thank you.

»
14 hours ago, # |
  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 :'(