A2SV_Group6's blog

By A2SV_Group6, history, 19 months ago, In English

Here is the contest link.

A. Mahmoud and Ehab and the even-odd game

Hint 1
Hint 2
Hint 3
Solution
Code

B. The Ethiopian Lakes

Solution
Code

C. Maedot's Apple Tree

Solution
Code - Recursive DFS
Code - Iterative DFS

D. Lakes in Bahirdar

Hint
Solution
Code

E. Cycle in Graph

Solution
Code
  • Vote: I like it
  • +5
  • Vote: I do not like it

»
19 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by A2SV_Group6 (previous revision, new revision, compare).

»
19 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Link doesn't work, put the invitation link

»
19 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by A2SV_Group6 (previous revision, new revision, compare).

»
19 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Can anyone explain E ?

  • »
    »
    19 months ago, hide # ^ |
    ← Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    one way to think about it, is to understand the fact that every node has at least $$$k$$$ neighbors. lets assume some path in a graph to be $$$A1,A2,A3,A4,....,Ai$$$ where the length of this path is $$$i \gt = k + 1$$$.

    We know $$$Ai$$$ will have at least $$$k$$$ neighbors, we can always find this type of path where one of the $$$k$$$ neighbors of $$$Ai$$$ will be inside the path itself(a back edge) making a simple cycle, you just have to make sure this node is $$$k$$$ nodes away from $$$Ai$$$.

    In the case where there are no neighbors of $$$Ai$$$ inside the path it means we can explore further nodes through this path.