Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

A problem with dfs....

Revision en2, by ChairMan, 2021-08-30 01:57:22

Hi, i'm trying to solve a cool problem but can't figure out how we can do it.

What is the minimum number of $$$moves$$$ to get from $$$x$$$ to $$$z$$$.

Input :

N

X, Y

pairs...

Eg :

5

1 3

1 2

2 4

2 5

5 6

6 3

ANS = 5 : 1,2 — 2,4 — 2,5 — 5,6 — 6,3

if someome please can help me with implementation , it would be cool.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English ChairMan 2021-08-30 01:57:22 73
en1 English ChairMan 2021-08-30 01:56:47 354 Initial revision (published)