« Last edit by ndv on Wed Jun 25, 2008 6:02 pm. »
| Put 8 rooks on a numbered chessboard so that they do not attack each other and the sum of numbers is minimal | |
|---|---|
Complexity (1-100): 20
Each
square of the chess board is marked with a natural number. Put eight
rooks on the board so that they are not under attack and the sum of
numbers of the occupying squares is minimal. Self-test: The chess-board (download: input.txt): |
|
| Solution: | Show/hide explanation | solution-simple.pas |
Page: 1
| Author | Post |
|---|---|
|
#1 Tue Jun 17, 2008 12:13 pm
|
|
|
Administrator
Registered: Jun 2008
Posts: 2
|
There is a more effective solution to this problem: divide the board in two parts 4 columns in each. Then solve two subproblems for each combination of 4 from 8 rows in each part. Furthermore, we can check for the equivalent rows in each part. This can cut down on the number of combinations.
« Last edit by ndv on Wed Jun 25, 2008 6:02 pm. » |
Page: 1
Book of programming problems is powered by UseBB 1 Forum Software | Contact Admin