## 3062: 1.5.4 Checker Challenge 跳棋的挑战

[提交][状态][讨论版][命题人:]

## 描述

0 1 2 3 4 5 6 ------------------------- 1 | | O | | | | | ------------------------- 2 | | | | O | | | ------------------------- 3 | | | | | | O | ------------------------- 4 | O | | | | | | ------------------------- 5 | | | O | | | | ------------------------- 6 | | | | | O | | -------------------------

行号 1 2 3 4 5 6



(checker.in)

(checker.out)

## SAMPLE INPUT

6


## SAMPLE OUTPUT

2 4 6 1 3 5
3 6 2 5 1 4
4 1 5 2 6 3
4


## Hint1

   function placequeen(column) { # place columns 0..max-1 if (column == max) { deal with answer; return; } for (row = 0; row < max; row++) { if (canplacequeen (row)) { mark queen placed at column,row; placequeen(column+1); un-mark queen placed at column,row; } } }

## Hint2

    function placequeen(column) { # place columns 0..max-1 if (column == max) { deal with answer; return; } for (row = 0; row < max; row++) { if (rowok[row] && canplacequeen(row,column)) { rowok[row] = 1; mark queen placed at column,row; placequeen(column+1); un-mark queen placed at column,row; rowok[row] = 0; } } }

[提交][状态]