diff --git "a/LiiNi-coder/202507/15 BOJ \352\260\220\354\213\234.md" "b/LiiNi-coder/202507/15 BOJ \352\260\220\354\213\234.md" new file mode 100644 index 00000000..e9d54a79 --- /dev/null +++ "b/LiiNi-coder/202507/15 BOJ \352\260\220\354\213\234.md" @@ -0,0 +1,144 @@ +```java +import java.awt.Point; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList;import java.util.Map; +import java.util.StringTokenizer; + +public class B15683 { + static class CCTV{ + int id; + Point p; + public CCTV(int id, Point p) { + this.id = id; + this.p = p; + } + } + private static BufferedReader br; + private static int m; + private static int n; + private static LinkedList combinations; + private static int[] comb; + private static ArrayList cctvs; + private static HashSet walls; + private static ArrayDeque buffer; + private static int[][] drdcs = { + {0, 1},{1, 0},{0, -1}, {-1, 0} + }; + private static int[][][] indexesDrdcsAtId = {null, {{0}, {1}, {2}, {3}} + ,{{0, 2}, {1, 3}, {0, 2}, {1, 3}} + ,{{0, 1}, {1, 2}, {2, 3}, {3, 0}} + ,{{0, 1, 2}, {1, 2, 3}, {2, 3, 0}, {3, 0, 1}} + ,{{0, 1, 2, 3}, {0, 1, 2, 3}, {0, 1, 2, 3}, {0, 1, 2, 3}}}; + private static int[][] map; + public static void main(String[] args) throws IOException { + br = new BufferedReader(new InputStreamReader(System.in)); + var tokens = br.readLine().split(" "); + n = Integer.parseInt(tokens[0]); + m = Integer.parseInt(tokens[1]); + walls = new HashSet(); + cctvs = new ArrayList(); + map = new int[n][m]; + for(int r = 0; r(); + int[] directions = (int[]) iterator.next(); + + for(int i = 0; i= n || nc <0 || nc>=m) || walls.contains(new Point(nr, nc))) { + break; + } + if(map[nr][nc] >= 1 && map[nr][nc] <= 5) + continue; + map[nr][nc] = cctv.id; + buffer.addLast(new Point(nr, nc)); + } + + } + } + + private static LinkedList getCombinations() { + combinations = new LinkedList(); + comb = new int[cctvs.size()]; + recur(0); + + return combinations; + } + + private static void recur(int index) { + if(index == cctvs.size()) { + combinations.add(comb.clone()); + return; + } + for(int i = 0; i<4; i++) { + comb[index] = i; + recur(index+1); + } + + } + +} +```