l*********y 发帖数: 142 | 1 顺手写了一个,46min整。也没用状态压缩,待会看一下gloomyturkey的code。
#include
#include
#include
#include
#include
#include
#include
|
|
j*********r 发帖数: 24733 | 2 反驳啥,Legal islegal,illegal isillegal。 If you don't have a border, you
don't have a country. |
|
l*****a 发帖数: 14598 | 3 public void eightQueens(int[] result,int cur)
{
if(cur==8) { OUTPUT; return; }
for(int i=0;i<8;i++) {
result[cur]=i;
if (isLegal(result,cur)) eightQueens(result,cur+1);
}
} |
|