From daaa0f40ff8ac9a6fca8aa22b432ebf0905f389a Mon Sep 17 00:00:00 2001 From: oncsr Date: Fri, 14 Feb 2025 22:07:42 +0900 Subject: [PATCH] =?UTF-8?q?[20250214]=20BOJ=20/=20G3=20/=20=EB=AF=B8?= =?UTF-8?q?=EC=B9=9C=20=EC=95=84=EB=91=90=EC=9D=B4=EB=85=B8=20/=20?= =?UTF-8?q?=EA=B6=8C=ED=98=81=EC=A4=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...04\353\221\220\354\235\264\353\205\270.md" | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 "khj20006/202502/14 BOJ G3 \353\257\270\354\271\234 \354\225\204\353\221\220\354\235\264\353\205\270.md" diff --git "a/khj20006/202502/14 BOJ G3 \353\257\270\354\271\234 \354\225\204\353\221\220\354\235\264\353\205\270.md" "b/khj20006/202502/14 BOJ G3 \353\257\270\354\271\234 \354\225\204\353\221\220\354\235\264\353\205\270.md" new file mode 100644 index 00000000..844b1eff --- /dev/null +++ "b/khj20006/202502/14 BOJ G3 \353\257\270\354\271\234 \354\225\204\353\221\220\354\235\264\353\205\270.md" @@ -0,0 +1,115 @@ +```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 R, C; + static char[][] arr; + static char[] command; + static int x, y; + static List crazy; + static int[] dx = {0,1,1,1,0,0,0,-1,-1,-1}; + static int[] dy = {0,-1,0,1,-1,0,1,-1,0,1}; + + public static void main(String[] args) throws Exception { + + ready(); + solve(); + + bwEnd(); + + } + + static void ready() throws Exception{ + + nextLine(); + R = nextInt(); + C = nextInt(); + arr = new char[R][C]; + crazy = new ArrayList<>(); + + for(int i=0;i x) arduino[0]--; + else if(arduino[0] < x) arduino[0]++; + + if(arduino[1] > y) arduino[1]--; + else if(arduino[1] < y) arduino[1]++; + + cnt[arduino[0]][arduino[1]]++; + + if(arduino[0] == x && arduino[1] == y) return false; + } + + + crazy = new ArrayList<>(); + + for(int i=0;i