krish2004's blog

By krish2004, history, 2 hours ago, In English

https://codeforces.com/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

Tags dsu
  • Vote: I like it
  • -3
  • Vote: I do not like it

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

You don't need DSU for this problem, you can just do regular flood fill like this

  • »
    »
    117 minutes ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    But whats the error if I am implementing it using dsu in vs code its running but during submission it is not.