cf/mirror

Anti-Tetris

CF
1578A2800· international gm2s1024 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
3 2
aa
ab
aa
Output
2
2 DS
1 S
Sample 2of 3
Input
5 6
....dd
.ccccd
.cbbdd
.aab.a
aabbaa
Output
5
2 DDDS
4 DDLS
6 DDDS
2 DS
5 S
Sample 3of 3
Input
5 3
...
aab
abb
aab
.bb
Output
-1
1578A.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…