-
Notifications
You must be signed in to change notification settings - Fork 1
28-kokeunho #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
28-kokeunho #116
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ฐฑํธ๋ํน์ ์ดํดํ๊ณ ์์ผ๋ฉด ์ ํ์์๋ ๋ฌธ์ ์๋ค์.
์ ๋ ์ ์ผ ์ฒ์์ ๋ฌธ์ ๋ฅผ ์ฝ๊ณ ์ฌ๋์ด ํธ๋๊ฒ ๋ง๋ฅ ํ์ ๋ 0์ ๋ฐ๊ฟ๋๋ ๋ฐฉ๋ฒ์ ๋ ์ฌ๋ฆฌ๋ ค๊ณ ํ์ด์.
๊ทธ ๋ฐฉ๋ฒ์ 3๋ถ๋ง์ ์ ์์ต๋๋ค.
๊ฑฐ์ ai๋ชจ๋ธ ์์ค์ ๊ฐ๋ฐ์ด ํ์ํ ๊ฒ ๊ฐ๋๊ตฐ์.
๊ทธ๋ฆฌ๊ณ ์ด์ฐจํผ ๊ทธ๋ฐ 0์ด ์กด์ฌํ์ง ์์ผ๋ฉด ์ธ๋ชจ์๋ ํ๋์ด ๋๋ฒ๊ธฐ๋๋ฌธ์ด์ฃ .
๊ทธ ๋ค์ ์๊ฐ๋ ๋ฐฉ์์ด ๋ฐฑํธ๋ํน์
๋๋ค.
bool ๋ฐฐ์ด์ ๋๊ณ ๊ฐ๋ก ์ธ๋ก ๋ค๋ชจ๋ฅผ ๊ฒ์ฌํด์ ํ์ฌ ์ขํ์ ๋์ ์ ์๋ ๋
์๋ค์ ๋ฃ์ผ๋ฉฐ backtracking ํ๋ ๋ฐฉ์์ด์ฃ
๊ตฌ์กฐ๋ ํ 40๋ถ ์ ๋์ ์์ฑ์ ํ๋๋ฐ, ๋ฒ ์ด์ค์ผ์ด์ค๋ฅผ ๋ฃ์ง ์์๊ณ ๊ทธ๊ฑธ ๋์น์ฑ์ง ๋ชปํด์ ๋ค๋ฅธ๊ณณ๋ง ๊ณ ์น๋ค ์๊ฐ์ด ํ 15๋ถ ํ๋ ๋ค์.
๊ณ ์น๊ธฐ ์ ์๋ 1% ์๊ฐ์ด๊ณผ...์๋ฉ์ด์์ต๋๋ค.
๋ฒ ์ด์ค์ผ์ด์ค๋ฅผ ๋ฃ์ด์ฃผ๊ณ ๋ค์ ์ ์ถํด๋ดค์ต๋๋ค.
์ด๋ฒ์ 80% ์ฏค์์ ์๊ฐ์ด๊ณผ๊ฐ ๋จ๋๋ผ๊ตฌ์.
๋์ ํ ์ด์ ๋ฅผ ๋ชจ๋ฅด๊ฒ ์ด์ gpt์ ๋ฃ์ด๋ดค์ต๋๋ค.
map์ RB Tree์ฌ์ ์ฝ์
์๋๊ฐ O(1)์ด ์๋๋ผ๋ ๊ฒ์ด ๋ฌธ์ ์๋ค์...
9๊ฐ ์ ๋๋ฉด ์๊ด ์์ ์ค ์์๋๋ฐ...
๊ทธ๋์ map์ vector๋ก ๋ฐ๊พธ์ด์ฃผ๋ ๋ฐ๋ก ์ฑ๊ณต์ด์์ต๋๋ค.
#include <iostream>
#include <vector>
using namespace std;
const int EMPTY = 0;
const int N = 9;
vector<vector<int>> board(N, vector<int>(N, EMPTY));
void checkRow(vector<bool>& cannot, int x) {
for (int y = 0; y < N; y++) {
cannot[board[y][x]] = true;
}
}
void checkCol(vector<bool>& cannot, int y) {
for (int x = 0; x < N; x++) {
cannot[board[y][x]] = true;
}
}
void checkSqr(vector<bool>& cannot, int y, int x) {
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
cannot[board[(y / 3) * 3 + i][(x / 3) * 3 + j]] = true;
}
}
}
bool backtracking(int y_, int x_) {
for (int y = y_; y < N; y++) {
for (int x = 0; x < N; x++) {
if (board[y][x] == EMPTY) {
vector<bool> cannot(N + 1, false); // (y, x)์ ๋์ ์ ์๋ ์๋ค์ true
checkRow(cannot, x);
checkCol(cannot, y);
checkSqr(cannot, y, x);
for (int candi = 1; candi <= N; candi++) {
if (!cannot[candi]) {
board[y][x] = candi;
if (backtracking(y, x)) return true;
board[y][x] = EMPTY;
}
}
return false;
}
}
}
return true;
}
int main() {
ios_base::sync_with_stdio(0);
cout.tie(0);
cin.tie(0);
for (int y = 0; y < N; y++) {
for (int x = 0; x < N; x++) {
cin >> board[y][x];
}
}
backtracking(0, 0);
cout << endl;
for (int y = 0; y < N; y++) {
for (int x = 0; x < N; x++) {
cout << board[y][x] << " ";
}
cout << endl;
}
return 0;
}
9kyo-hwang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ตฌ์กฐ๊ฐ ์ฝ๊ฐ N-Queen ๋ฌธ์ ๋ ๋น์ทํ ๊ฒ ๊ฐ์์. ๋น ์นธ์ ๋ํด 1๋ถํฐ 9๊น์ง ์๋ฅผ ๋์ ํด๋ณด๊ณ , ๊ทธ๊ฒ ๊ฐ๋ฅํ ์ง ๊ฒ์ฌํด์ ๊ฐ๋ฅํ๋ฉด true, ์๋๋ผ๋ฉด false. ๋ฑ Promising & Backtracking ๊ตฌ์กฐ๊ฐ ๋๋๋ผ๊ตฌ์ ใ ใ
์ฝ๋
#include <iostream>
#include <array>
#include <vector>
#define EMPTY 0
using namespace std;
vector<pair<int, int>> v;
array<array<int, 9>, 9> arr;
bool Promising(size_t count) {
const auto &[empty_x, empty_y] = v[count];
for (int col = 0; col < 9; col++) { // ํ์ ๊ฒน์น๋ ์ซ์ ์๋ ์ง ํ์ธ
if ((col != empty_y) && (arr[empty_x][col] == arr[empty_x][empty_y]))
return false;
}
for (int row = 0; row < 9; row++) { // ์ด์ ๊ฒน์น๋ ์ซ์ ์๋ ์ง ํ์ธ
if ((row != empty_x) && (arr[row][empty_y] == arr[empty_x][empty_y]))
return false;
}
// ๊ตฌ์ญ์ ๊ฒน์น๋ ์ซ์ ์๋ ์ง ํ์ธ
int area_x = empty_x / 3;
int area_y = empty_y / 3;
for (int row = area_x * 3; row < area_x * 3 + 3; row++) {
for (int col = area_y * 3; col < area_y * 3 + 3; col++) {
if ((row != empty_x) && (col != empty_y) && (arr[empty_x][empty_y] == arr[row][col]))
return false;
}
}
return true;
}
bool Sudoku(size_t count = 0) {
if (count == v.size())
return true;
const auto &[x, y] = v[count];
for (int i = 1; i <= 9; i++) {
arr[x][y] = i;
if (!Promising(count))
continue;
if (Sudoku(count + 1))
return true;
}
arr[x][y] = 0;
return false;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
for (int i = 0; i < 9; i++) {
for (int j = 0; j < 9; j++) {
cin >> arr[i][j];
if (arr[i][j] == EMPTY)
v.emplace_back(i, j);
}
}
if (Sudoku()) {
for(const auto &i : arr) {
for(const auto &j : i) {
cout << j << " ";
}
cout << "\n";
}
}
return 0;
}๊ทธ๋ฐ๋ฐ ์ด๋ฌ๋ฉด ์๊ฐ์ด ๋๋ฌด ์ค๋ ๊ฑธ๋ฆฌ๋ ๋จ์ ์ด ์์ต๋๋ค. ๋งค ๋ฒ 9x9 ๋ณด๋์ ๋ํด ํ์ฌ ์ค๋์ฟ ๊ฐ ์์ฑ๋์๋์ง ๋ค ํ์ด๋ณด๊ธฐ ๋๋ฌธ์ด์ฃ .

์ด๋ฅผ ๊ฐ ํ/์ด/3x3 ๋ฐ์ค ๊ตฌ๊ฐ ๋ณ๋ก ์ฌ์ฉ๋ ์ซ์๋ฅผ ์บ์ฑํ๋ ์์ผ๋ก ์ต์ ํํ ์ ์์ต๋๋ค.
๊ฐ์ ๋ ์ฝ๋
#include <bits/stdc++.h>
using namespace std;
constexpr int EMPTY = 0;
int board[9][9];
vector<pair<int, int>> empties;
bool rowUsed[9][10], colUsed[9][10], boxUsed[9][10];
bool dfs(int idx = 0) {
if(idx == empties.size()) {
return true;
}
const auto& [r, c] = empties[idx];
int b = (r / 3) * 3 + c / 3;
for(int num = 1; num <= 9; ++num) {
if(rowUsed[r][num] || colUsed[c][num] || boxUsed[b][num]) {
continue;
}
board[r][c] = num;
rowUsed[r][num] = colUsed[c][num] = boxUsed[b][num] = true;
if(dfs(idx + 1)) {
return true;
}
rowUsed[r][num] = colUsed[c][num] = boxUsed[b][num] = false;
board[r][c] = EMPTY;
}
return false;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
for(int i = 0; i < 9; ++i) {
for(int j = 0; j < 9; ++j) {
cin >> board[i][j];
if(board[i][j] == 0) {
empties.emplace_back(i, j);
} else {
int num = board[i][j];
rowUsed[i][num] = true;
colUsed[j][num] = true;
boxUsed[(i / 3) * 3 + j / 3][num] = true;
}
}
}
dfs();
for(int i = 0; i < 9; ++i) {
for(int j = 0; j < 9; ++j) {
cout << board[i][j] << " ";
}
cout << "\n";
}
return 0;
}GPT๊ฐ ๋๊ฒ ๋ ํนํ ๋ฐฉ๋ฒ์ ์๊ฐํด์คฌ๋๋ฐ ๋ญ๊ฐ ๋ง์ด ๋ ํนํ ๊ธฐ๋ฒ์ด๋ผ ๊ถ๊ธํ์ ๋ถ์ ์ฝ์ด๋ณด์ ๋...?
๋นํธ๋ง์คํน + MRV
#include <bits/stdc++.h>
using namespace std;
// 9ร9 ์ค๋์ฟ
int board[9][9];
// ํ, ์ด, ๋ธ๋ก๋ณ๋ก ์ฌ์ฉ๋ ์ซ์๋ฅผ ๋นํธ๋ง์คํฌ๋ก ๊ด๋ฆฌ
// ๋ง์คํฌ์ ๋นํธ k(1โคkโค9)๊ฐ 1์ด๋ฉด ์ซ์ k๊ฐ ์ด๋ฏธ ์ฌ์ฉ๋ ์ํ
int rowMask[9], colMask[9], boxMask[9];
// ๋น ์นธ ์ขํ ๋ชฉ๋ก
vector<pair<int,int>> empties;
// ์ฌ๊ท ํ์: filled๊ฐ๋ฅผ ์ฑ์ด ์ํ์์ ๋๋จธ์ง๋ฅผ ์ฑ์ฐ๋ ํจ์
bool solve(int filled = 0) {
if (filled == (int)empties.size())
return true; // ๋ชจ๋ ์ฑ์ ์ผ๋ฉด ์ฑ๊ณต
// MRV: ๋จ์ ํ๋ณด๊ฐ ๊ฐ์ฅ ์ ์ ์นธ์ ์ฐพ์์ ์์ผ๋ก ๊ฐ์ ธ์จ๋ค
int best = -1, minCount = 10;
for (int i = filled; i < (int)empties.size(); ++i) {
auto [r, c] = empties[i];
int b = (r/3)*3 + c/3;
int avail = ~(rowMask[r] | colMask[c] | boxMask[b]) & 0x3FE;
int cnt = __builtin_popcount(avail);
if (cnt < minCount) {
minCount = cnt;
best = i;
if (cnt == 0) break; // ํ๋ณด๊ฐ ์์ผ๋ฉด ๋ฐ๋ก ์คํจ
}
}
if (minCount == 0) return false;
// ํ๋ณด ์ ์ ์นธ์ filled ์์น๋ก ์ค์
swap(empties[filled], empties[best]);
auto [r, c] = empties[filled];
int b = (r/3)*3 + c/3;
int avail = ~(rowMask[r] | colMask[c] | boxMask[b]) & 0x3FE;
// ๊ฐ๋ฅํ ์ซ์ ํ๋์ฉ ์๋
while (avail) {
int bit = avail & -avail; // ๊ฐ์ฅ ๋ฎ์ ๋นํธ
int d = __builtin_ctz(bit); // ๊ทธ ๋นํธ์ ์ธ๋ฑ์ค = ์ซ์
avail ^= bit;
// ์ซ์ d๋ฅผ ๋๋๋ค
board[r][c] = d;
rowMask[r] |= bit;
colMask[c] |= bit;
boxMask[b] |= bit;
if (solve(filled+1))
return true;
// backtrack
rowMask[r] ^= bit;
colMask[c] ^= bit;
boxMask[b] ^= bit;
board[r][c] = 0;
}
// ์์์น ๋ณต๊ตฌ
swap(empties[filled], empties[best]);
return false;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
// ์
๋ ฅ๊ณผ ์ด๊ธฐ ๋ง์คํฌ ์ค์
for (int i = 0; i < 9; i++) {
for (int j = 0; j < 9; j++) {
cin >> board[i][j];
if (board[i][j]) {
int bit = 1 << board[i][j];
rowMask[i] |= bit;
colMask[j] |= bit;
boxMask[(i/3)*3 + j/3] |= bit;
} else {
empties.emplace_back(i, j);
}
}
}
solve();
// ๊ฒฐ๊ณผ ์ถ๋ ฅ
for (int i = 0; i < 9; i++) {
for (int j = 0; j < 9; j++) {
cout << board[i][j] << ' ';
}
cout << "\n";
}
return 0;
}์ฌ์ง์ด ํฌ๋์ค X ๋ผ๋ ์๊ณ ๋ฆฌ์ฆ์ ์ฌ์ฉํ๋ฉด ๊ทนํ์ผ๋ก ๋น ๋ฅด๊ฒ ํด๊ฒฐํ ์ ์๋ค๊ณ ํ๋๋ฐ ์ฝ๋ค๋ณด๋ ์ด์ง๋ฌ์์ ์ ํฌ๊ธฐํ์ต๋๋ค ใ ใ ...
wnsmir
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ทผํธ๋ ๋ฌธ์ ๋ฅผ ๋ณด๋ฉด ๋ฐฑํธ๋ํน ํน์ ์์ ํ์๋ฌธ์ ๊ฐ ๋ง์๊ฒ ๊ฐ์ต๋๋ค.
์ ๊ฐ ์ฌ๊ท๋ถ๋ถ์ด ์ฝํ๋ฐ ๋๋ถ์ ๋์์ด ๋ง์ด ๋ฉ๋๋ค ใ
ใ
์ฒ์์๋ ๋น์นธ๋ง๋ค 1๋ถํฐ 9๊น์ง ๋ค ๋ฃ์ด๋ณด๋์์ผ๋ก ํ๋ค๊ฐ ๋ฉ๋ชจ๋ฆฌ์ด๊ณผ๋์
๋จ์ ํ๋ณด๊ฐ ์ ์ ์นธ๋ถํฐ ๋ฃ์ด๋ณด๋๋ก ์งํฉ์ ์ด์ฉํด์ ๋ถ๊ธฐ๋ฅผ ์ต์ํํ์ต๋๋ค.
import sys
input = sys.stdin.readline
# 1) ์
๋ ฅ ๋ฐ์ผ๋ฉด์ board, rows, cols, boxes, empties ๊ตฌ์ฑ
board = [list(map(int, input().split())) for _ in range(9)]
rows = [set(range(1,10)) for _ in range(9)]
cols = [set(range(1,10)) for _ in range(9)]
boxes= [set(range(1,10)) for _ in range(9)]
empties = []
for r in range(9):
for c in range(9):
v = board[r][c]
if v:
rows[r].remove(v)
cols[c].remove(v)
boxes[(r//3)*3 + (c//3)].remove(v)
else:
empties.append((r,c))
# 2) DFS ํจ์: ๋น ์นธ์ด ์์ผ๋ฉด True ๋ฐํ
def dfs():
if not empties:
return True
# ๋จ์ ๋น ์นธ ์ค ํ๋ณด ์๊ฐ ๊ฐ์ฅ ์ ์ ์นธ์ ์ ํ
best = min(
empties,
key=lambda x: len(rows[x[0]] & cols[x[1]] & boxes[(x[0]//3)*3 + (x[1]//3)])
)
r, c = best
b = (r//3)*3 + (c//3)
candidates = rows[r] & cols[c] & boxes[b] # ํ๋ณด ์ซ์ ์งํฉ
if not candidates:
return False
empties.remove(best)
for v in candidates:
# ๋ฐฐ์น
board[r][c] = v
rows[r].remove(v)
cols[c].remove(v)
boxes[b].remove(v)
if dfs():
return True
# ๋๋๋ฆฌ๊ธฐ
board[r][c] = 0
rows[r].add(v)
cols[c].add(v)
boxes[b].add(v)
empties.append(best)
return False
# 3) ์คํ ๋ฐ ์ถ๋ ฅ
dfs()
out = []
for row in board:
out.append(" ".join(map(str, row)))
sys.stdout.write("\n".join(out))
g0rnn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ฌธ์ ๋ฅผ ์ ์ํ๋ค๋ณด๋ ๋ฐฑํธ๋ ํน์ด ์ข ์ด๋ ค์์ก๋ค์.. ์์ ์ ๋จธ๋ฆฌ ์์ ๋ฐฑํธ๋ ํน๋ง ๋ ์ค๋ฅด๋ ์์ ์ด ์์๋๋ฐ.. ํํ
๊ทผ๋ฐ ๋ฌธ์ ๊ฐ ์ฌ๋ฐ์์ต๋๋ค. ๋ฐฑํธ๋ ํน์ ์ข ์ฌ๋ฐ๊ฒ ์ฌ์ฉํ๋ ๋๋์ด๋ค์.
๊ทผํธ๋๊ณผ ๋ค๋ฅธ๋ถ๋ค์ ์บ์ฑ์ ์ฌ์ฉํ์ฌ ์๋๋ฅผ ๋์ธ๊ฑฐ ๊ฐ์๋ฐ, ์ ๋ชจ๋ ์นธ์ ํ์ธํ์ต๋๋ค. ๋ง์ฝ 0์ด ์๋๋ผ๋ฉด ๋ค์ ์นธ์ผ๋ก ๋์ด๊ฐ๊ณ , ๊ทธ๋ ๊ฒ ๋ชจ๋ ์นธ์ ์ํํ๋ค๋ฉด ์ข
๋ฃํ๋๋ก ํ์์ต๋๋ค. ๋ชจ๋ ์นธ์ ์ํํ๊ณ x์ y๊ฐ ๋ฒ์ ๋ฐ์ผ๋ก ๋์ด๊ฐ์ ๋ ์ค๋์ฟ ๋ฅผ ์ฌ๋ฐ๋ฅด๊ฒ ์ฑ์ ๋ค๋ ์๋ฏธ์ด๋ฏ๋ก true๋ฅผ ๋ฐํํฉ๋๋ค.
package beakjoon;
import java.io.*;
import java.util.*;
public class Sol2580 {
static int[][] board = new int[9][9];
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st;
for (int i = 0; i < 9; i++) {
st = new StringTokenizer(br.readLine());
for (int j = 0; j < 9; j++) {
board[i][j] = Integer.parseInt(st.nextToken());
}
}
backtracking(0, 0);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < 9; i++) {
for (int j = 0; j < 9; j++) {
sb.append(board[i][j]).append(" ");
}
sb.append("\n");
}
System.out.print(sb.toString());
}
private static boolean backtracking(int x, int y) {
if (x == 9) { // ํ ์ค ๋๋๋ฉด ๋ค์ ์ค๋ก
x = 0;
y++;
if (y == 9) return true; // ๋ชจ๋ ์นธ์ ๋ค ์ฑ์ด ๊ฒฝ์ฐ
}
if (board[y][x] != 0) {
return backtracking(x + 1, y); // ์ด๋ฏธ ์ฑ์์ง ์นธ์ด๋ฉด ๋ค์ ์นธ์ผ๋ก
}
for (int num = 1; num <= 9; num++) {
if (isValid(y, x, num)) {
board[y][x] = num;
if (backtracking(x + 1, y)) return true;
board[y][x] = 0;
}
}
return false;
}
// ํ์ฌ ์์น์ num์ ๋ฃ์ ์ ์๋์ง ๊ฒ์ฌ
private static boolean isValid(int y, int x, int num) {
// ๊ฐ์ ํ
for (int i = 0; i < 9; i++) {
if (board[y][i] == num) return false;
}
// ๊ฐ์ ์ด
for (int i = 0; i < 9; i++) {
if (board[i][x] == num) return false;
}
// ๊ฐ์ 3x3 ๋ฐ์ค
int startY = (y / 3) * 3;
int startX = (x / 3) * 3;
for (int i = startY; i < startY + 3; i++) {
for (int j = startX; j < startX + 3; j++) {
if (board[i][j] == num) return false;
}
}
return true;
}
}


๐ ๋ฌธ์ ๋งํฌ
[BOJ] ์ค๋์ฟ
https://www.acmicpc.net/problem/2580
โ๏ธ ์์๋ ์๊ฐ
1h30m
โจ ์๋ ์ฝ๋
๋ฐฑํธ๋ํน์ผ๋ก ๋น์นธ์ ๋ชจ๋ ์ฑ์ฐ๋ฉด ๊ทธ ๊ฒฐ๊ณผ๋ฅผ ์ถ๋ ฅํ๋๋ก ํ์์ต๋๋ค.
์ฐ์ map์ ์ ๋ ฅ ๋ฐ์ผ๋ฉด์ ๋น์นธ์ ์ขํ๋ฅผ ๋ฆฌ์คํธ๋ก ๋ฐ์ต๋๋ค.
๊ทธ๋ฆฌ๊ณ ๋น์นธ ์ขํ๋ง๋ค ๋ค์ด๊ฐ ์ ์๋ ์ซ์ ๋ฆฌ์คํธ๋ฅผ ๊ตฌํฉ๋๋ค.
์ด๋ ํด๋น ์ขํ์ ํ, ์ด ๋ฟ๋ง ์๋๋ผ ์ขํ๊ฐ ํฌํจ๋ 3 * 3 ๋ฐ์ค ๋ด์์๋ ๋ฐ์ ธ์
ํด๋น ์ขํ์ ๋ค์ด๊ฐ ์ ์๋ ์ซ์ ๋ฆฌ์คํธ๋ฅผ ๋ฝ์์ผํฉ๋๋ค.
(์ค๋์ฟ ๋ฅผ ์ ์ํด๋ณด๊ณ ๋ฌธ์ ๋ ์ ๋๋ก ์ ์ฝ์ด์ 3*3 ๋ฐ์ค๋ ๋ฐ์ ธ์ผํ๋์ง ๋ชจ๋ฅด๊ณ ์์์ต๋๋ค..)
์ฌ๊ท์ ์ผ๋ก sudoku ํจ์๋ฅผ ํธ์ถํ๋ค
ํจ์ ํธ์ถ ํ์๊ฐ ๋น์นธ์ ๊ฐฏ์์ ๊ฐ์์ก์ ๊ฒฝ์ฐ, ๋ชจ๋ ๋น์นธ์ ์ฑ์ ๋ค๋ ๊ฒ์ด๋ฏ๋ก
๊ทธ ์์ ์ map์ ์ถ๋ ฅํฉ๋๋ค.
๐ ์๋กญ๊ฒ ์๊ฒ๋ ๋ด์ฉ