CCC '09 S3 - Degrees Of Separation


Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 256M

Problem type
Allowed languages
C++, Python
Sample Output
2
3
4

Explanation

  • n 20 : Person 20 has two friends (10 and 9).
  • f 20 : The friends of friends of 20 are 8, 11, 12.
  • s 20 6 : The shortest path is 20 → 9 → 8 → 7 → 6.

Comments

There are no comments at the moment.