HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Kovrov IT > problem:


2010.C. 50255 - Bishops

Guest
• Discussion of problem (1)

Volume problems

• 2009.D. 50259 - Many-coloured roads
• 2009.E. 50266 - Kovrov
• 2009.F. 50267 - Interesting permutat...
• 2009.G. 50260 - What about judges?
• 2009.H. 50268 - Triangles
• 2009.I. 50278 - ATM
• 2010.A. 50287 - Providers
• 2010.B. 50281 - Primes
• 2010.C. 50255 - Bishops
• 2010.D. 50277 - Unusual Lottery
• 2010.E. 50664 - Polygons
• 2010.F. 50265 - Liars and Knights
• 2010.G. 50256 - Sequence
• 2010.H. 50282 - Coins
• 2010.I. 50257 - Galls village
• 2010.J. 50258 - String manipulations

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 3000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Автор: Кирилл Бутин, ПГУ. Difficulty Epsilon

A bishop is a piece in the board game of chess. The bishop has no restrictions in distance for each move, but is limited to diagonal movement, forward and backward.

Consider a chessboard of size NxN.

Your must find the maximum number of bishops that can be placed on the chessboard, such that no pair of bishops can attack each other. Some cells are damaged. Bishops cannot be placed on these cells, but they can attack through them.

Input
The first line contains one integer N (1 ≤ N ≤ 100) - size of the chessboard. The following N lines describe the chessboard. Each line contains N symbols. '.' is entire cell, '#' is damaged.

Output
Output a single integer - the number of bishops that can be placed on the chessboard under the given restrictions.

Input 1 Output 1
2
..
..
2
Input 2 Output 2
2
.#
#.
1

Для отправки решений необходимо выполнить вход.

www.contester.ru