#418. B - Blank Bingo(空白宾果)
B - Blank Bingo(空白宾果)
Problem Statement
There is a grid, and some of the cells are marked.
The current state of the grid is given by strings of length consisting of o and .. A cell is marked when its character is o, and unmarked when it is ..
Find the minimum number of additional marks needed to achieve a bingo.
A bingo is achieved when all 5 cells in any row, column, or one of the two main diagonals are marked.
Input
Five lines, each containing a five-character string using only o and ..
Output
Print the minimum number of additional marks.
Samples
.o..o
..oo.
.o..o
o.o..
o..oo
2
o..oo
...o.
o.ooo
oo.o.
.o.oo
0
o..o.
.o...
..o.o
..o..
o...o
1