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
# | User | Rating |
---|---|---|
1 | jiangly | 3898 |
2 | tourist | 3840 |
3 | orzdevinwang | 3706 |
4 | ksun48 | 3691 |
5 | jqdai0815 | 3682 |
6 | ecnerwala | 3525 |
7 | gamegame | 3477 |
8 | Benq | 3468 |
9 | Ormlis | 3381 |
10 | maroonrk | 3379 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | -is-this-fft- | 165 |
3 | Um_nik | 160 |
4 | atcoder_official | 159 |
4 | Dominater069 | 159 |
6 | djm03178 | 157 |
7 | adamant | 153 |
8 | luogu_official | 150 |
8 | awoo | 150 |
10 | TheScrasse | 147 |
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
Name |
---|
have you considered the possibility that
ans
may be overflowing?I always use long long int, so I dont think that should be the issue :/
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.
That might be the problem, thank you.
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 :'(