Boboniu Walks on Graph
1394B2300· international master1s256 MB⌨ stdin/stdout
Examples
Sample 1of 3
Input
4 6 34 2 11 2 22 4 34 1 44 3 53 1 6
Output
2
Sample 2of 3
Input
5 5 11 4 15 1 22 5 34 3 43 2 5
Output
1
Sample 3of 3
Input
6 13 43 5 12 5 26 3 31 4 42 6 55 3 64 1 74 3 85 2 94 2 102 1 116 1 124 6 13
Output
1
58%
1394B.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…