https://codeforces.net/contest/1985/problem/H1. For this problem when I am running the same code on VS code it is coming correct but when I am submitting it is showing garbage value. 271078629
# | User | Rating |
---|---|---|
1 | tourist | 3947 |
2 | jiangly | 3734 |
3 | Radewoosh | 3646 |
4 | jqdai0815 | 3620 |
4 | Benq | 3620 |
6 | orzdevinwang | 3612 |
7 | ecnerwala | 3581 |
8 | Geothermal | 3569 |
8 | cnnfls_csy | 3569 |
10 | ksun48 | 3479 |
# | User | Contrib. |
---|---|---|
1 | awoo | 161 |
2 | maomao90 | 160 |
3 | nor | 157 |
4 | atcoder_official | 156 |
4 | cry | 156 |
6 | -is-this-fft- | 155 |
7 | maroonrk | 154 |
7 | adamant | 154 |
9 | djm03178 | 146 |
9 | Petr | 146 |
https://codeforces.net/contest/1985/problem/H1. For this problem when I am running the same code on VS code it is coming correct but when I am submitting it is showing garbage value. 271078629
Name |
---|
it can be solved like this
You don't need DSU for this problem, you can just do regular flood fill like this
But whats the error if I am implementing it using dsu in vs code its running but during submission it is not.