cf/mirror

Coloring Game

CF
1197F2700· international gm5s512 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
3
3 4 5
2
1 1 1
2 2 2
1 1 1
1 0 0
0 1 1
Output
14346
Sample 2of 3
Input
1
1
1
1 1 1
1 1 1
1 1 1
1 1 1
Output
1
Sample 3of 3
Input
3
1 1 1
1
1 1 1
1 1 1
1 1 1
1 1 1
Output
9
1197F.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)