cf/mirror

Rainbow Coins

CF
1147E3000· legendary gm6s256 MB⇄ interactive

Examples

Sample 1of 1
Input
3
3
1
1
1
3
1
0
0
6
000
010
100
001
000
Output
Q 1 1 2
Q 1 2 3
Q 1 1 3
A 3 0 0
1 2 3
 
 
Q 1 1 3
Q 1 2 3
Q 1 1 2
A 2 0 1
1 3
 
2
Q 3 1 2 3 4 5 6
Q 3 1 3 2 5 4 6
Q 3 1 4 2 6 3 5
Q 3 1 5 2 4 3 6
Q 3 1 6 2 3 4 5
A 2 2 2
1 4
2 5
3 6
1147E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)