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