From 5fc64d872dc99c4950c8184b99b1d49636bebbb3 Mon Sep 17 00:00:00 2001 From: oncsr Date: Wed, 12 Feb 2025 10:37:00 +0900 Subject: [PATCH] =?UTF-8?q?[20250212]=20BOJ=20/=20G2=20/=20=EB=B6=88?= =?UTF-8?q?=EC=BC=9C=EA=B8=B0=20/=20=EA=B6=8C=ED=98=81=EC=A4=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...2 \353\266\210\354\274\234\352\270\260.md" | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 "khj20006/202502/12 BOJ G2 \353\266\210\354\274\234\352\270\260.md" 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