Need help with a dfs simple problem !!

Правка en1, от rezidentura, 2022-09-17 20:23:31

This is the problem I want to discuss : 1661B - Getting Zero

I have this answer, It's not mine but I made it cleaner (I think).

The answer

I have two questions and thank you in advance.

1) Why deleting this line : return ans[x]; gives wrong answer.

2) why changing the code into the 2 code below gives wrong answer :

2 code
Теги dfs, math

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский rezidentura 2022-09-17 20:23:31 1533 Initial revision (published)