cf/mirror

Cooperative Game

CF
1137D2400· grandmaster1s512 MB⇄ interactive

Examples

Sample 1of 1
Input
2 05 12346789
 
3 246789 135 0
 
3 246789 0 135
 
3 246789 0 135
 
2 135 0246789
 
1 0123456789
Output
next 0 5
 
next 0 1 3
 
next 2 3 0 1 4 5 6 7 8 9
 
next 9 8 7 6 5 4 3 2 1 0
 
next 0 1 3 5
 
next 1 3 5
 
done
1137D.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)