Count BFS Graph
1906J2100· master1s1024 MB⌨ stdin/stdout
Examples
Sample 1of 4
Input
31 2 3
Output
3
Sample 2of 4
Input
31 3 2
Output
1
Sample 3of 4
Input
51 3 2 4 5
Output
17
Sample 4of 4
Input
111 2 3 4 5 6 7 8 9 10 11
Output
379394847
58%
1906J.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)