Блог пользователя azhar556

Автор azhar556, история, 6 лет назад, По-английски

Hi, I just solved my first dfs problem 1020B - Badge. Honestly i've never solve dfs before and i was thinking very long to understand this, this is very new for me. Summary, dfs in this problem is basically searching the one who visited twice and then break, and repeat several times depend the "n". This is my submission 45184407, in my submission i was trying to separate my dfs function to make easier to debug this and to make easier to read. One thing make me confused on this problem is the sequence is starting with one(1). Usually i starting with zero(0), but in this case its hard to implementing because the array input is based with one(1) too. Then to make easy i starting with one(1).

(newbie 996)

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Here is a code after converting to 0-based counting.