diff --git "a/khj20006/202502/12 BOJ G2 \353\266\210\354\274\234\352\270\260.md" "b/khj20006/202502/12 BOJ G2 \353\266\210\354\274\234\352\270\260.md" new file mode 100644 index 00000000..608e549c --- /dev/null +++ "b/khj20006/202502/12 BOJ G2 \353\266\210\354\274\234\352\270\260.md" @@ -0,0 +1,119 @@ +```java + +import java.util.*; +import java.io.*; + +class Main { + + // IO field + static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); + static StringTokenizer st; + + static void nextLine() throws Exception {st = new StringTokenizer(br.readLine());} + static int nextInt() {return Integer.parseInt(st.nextToken());} + static long nextLong() {return Long.parseLong(st.nextToken());} + static void bwEnd() throws Exception {bw.flush();bw.close();} + + // Additional field + static int[] d; + static boolean[] can; + static boolean[] on; + static int N, M; + static int[] root; + static int[] cnt; + static List[] V; + + public static void main(String[] args) throws Exception { + + ready(); + solve(); + + bwEnd(); + } + + static void ready() throws Exception{ + + nextLine(); + N = nextInt(); + M = nextInt(); + d = new int[] {-N,-1,1,N}; + + can = new boolean[N*N]; + on = new boolean[N*N]; + root = new int[N*N]; + cnt = new int[N*N]; + V = new List[N*N]; + for(int i=0;i(); + } + + for(int i=0;i