DeleteMe) 페이지 제목에 대한 통일성 관계상 페이지 이름 수정을 했습니다. --1002 == 8퀸즈 소스1 == 2h:30m, 71line {{{~cpp #include struct QUEEN{ int x; int y; }; int map[8][8]; bool MARK(QUEEN Pt); int main(){ QUEEN history[8]; int nQueens=0; history[0].x=0; history[0].y=0; bool bOk; while(!bOk || nQueens<8){ for(int i=0;i<8;i++) for(int j=0;j<8;j++) map[i][j]=0; for(i=0;i0) return false; for(int i=0;i<8;i++){ if(tmp[Pt.x][i]==2) return false; else tmp[Pt.x][i]=1; if(tmp[i][Pt.y]==2) return false; else tmp[i][Pt.y]=1; if(i-Pt.x+Pt.y<8 && i-Pt.x+Pt.y>=0){ if(tmp[i][i-Pt.x+Pt.y]==2) return false; else tmp[i][i-Pt.x+Pt.y]=1; } if(Pt.x+Pt.y-i<8 && Pt.x+Pt.y-i>=0){ if(tmp[i][Pt.x-i+Pt.y]==2) return false; else tmp[i][Pt.x-i+Pt.y]=1; } } tmp[Pt.x][Pt.y]=2; for(x=0;x<8;x++) for(int y=0;y<8;y++) map[x][y]=tmp[x][y]; return true; } }}}