HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Forums > Discussion of problems > topic:


Big Barn

There is a contest!

В настоящий момент идёт турнир. Некоторая информация и функции сервера недоступны до его окончания.

imesecanNov.24.2012 at 12:22:49 PM
0Сообщение скрыто

imesecanNov.24.2012 at 12:26:37 PM
1There are many different solutions.

imesecanNov.24.2012 at 03:24:15 PM
2Сообщение скрыто

imesecanNov.24.2012 at 03:29:31 PM
3It's not very big. I sent it as email. There are larger test cases

imesecanNov.24.2012 at 04:14:04 PM
4Сообщение скрыто

imesecanNov.24.2012 at 05:06:53 PM
5Сообщение скрыто

imesecanMar.13.2013 at 09:47:26 PM
6Here is the algorithm
Having N=250 you can understand that you can use a simple algorithm like N^4. Start from one corner and go one by one until to the other corner.
1 2 3 4 5 6 7 8
1 . . . . . . . .
2 . # . . . # . .
3 . . . . . . . .
4 . . . . . . . .
5 . . . . . . . .
6 . . . # . . . .
7 . . . . . . . .
8 . . . . . . . .
It asks square ranges that is to make our work easy. Let's say that you started from bottom left corner (normally you should start from (1,1), anyway). If that cell is an empty celll you start checking square ranges
7 . .
8 S .

imesecanMar.13.2013 at 09:48:16 PM
7if all cells in the newly added rows and columns are available cells, or not. If yes, increment the range and check the upper row and right column.
6 . . .
7 . . .
8 S . .
Because the inner cells of this new square have already been checked, just check the new row and column. If yes, Increment the size of the square
5 . . . .
6 . . . #
7 . . . .
8 S . . .
When we check the new row and column, we see that the largest square is 3 for the cell (1,8).

Repeat this process for all cells,


www.contester.ru