cf/mirror

Count BFS Graph

CF
1906J2100· master1s1024 MB⌨ stdin/stdout

Examples

Sample 1of 4
Input
3
1 2 3
Output
3
Sample 2of 4
Input
3
1 3 2
Output
1
Sample 3of 4
Input
5
1 3 2 4 5
Output
17
Sample 4of 4
Input
11
1 2 3 4 5 6 7 8 9 10 11
Output
379394847
1906J.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)