From abc326e8cbf640684f7b33ce246a9d0e34eed9ab Mon Sep 17 00:00:00 2001 From: lkhyun <102892446+lkhyun@users.noreply.github.com> Date: Sun, 23 Mar 2025 11:44:47 +0900 Subject: [PATCH] =?UTF-8?q?[20250323]=20BOJ=20/=20G5=20/=20=EC=9D=B8?= =?UTF-8?q?=EB=82=B4=EC=9D=98=20=EB=8F=84=EB=AF=B8=EB=85=B8=20=EC=9E=A5?= =?UTF-8?q?=EC=9D=B8=20=ED=98=B8=EC=84=9D=20/=20=EC=9D=B4=EA=B0=95?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...5\354\235\270 \355\230\270\354\204\235.md" | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 "lkhyun/202503/23 BOJ \352\263\250\353\223\2345 \354\235\270\353\202\264\354\235\230 \353\217\204\353\257\270\353\205\270 \354\236\245\354\235\270 \355\230\270\354\204\235.md" diff --git "a/lkhyun/202503/23 BOJ \352\263\250\353\223\2345 \354\235\270\353\202\264\354\235\230 \353\217\204\353\257\270\353\205\270 \354\236\245\354\235\270 \355\230\270\354\204\235.md" "b/lkhyun/202503/23 BOJ \352\263\250\353\223\2345 \354\235\270\353\202\264\354\235\230 \353\217\204\353\257\270\353\205\270 \354\236\245\354\235\270 \355\230\270\354\204\235.md" new file mode 100644 index 00000000..aa811ef3 --- /dev/null +++ "b/lkhyun/202503/23 BOJ \352\263\250\353\223\2345 \354\235\270\353\202\264\354\235\230 \353\217\204\353\257\270\353\205\270 \354\236\245\354\235\270 \355\230\270\354\204\235.md" @@ -0,0 +1,83 @@ +```java +import java.util.*; +import java.io.*; +public class Main { + static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); + static StringTokenizer st; + static int N = 0; // 행 개수 + static int M = 0; // 열 개수 + static int R = 0; // 라운드 횟수 + static int[][] board; //게임판 + static boolean[][] state; + static int[] di = {0,0,1,-1}; + static int[] dj = {1,-1,0,0}; + static int answer = 0; // 총 쓰러트린 개수 + public static void main(String[] args) throws Exception { + st = new StringTokenizer(br.readLine()); + N = Integer.parseInt(st.nextToken()); + M = Integer.parseInt(st.nextToken()); + R = Integer.parseInt(st.nextToken()); + board = new int[N+1][M+1]; + state = new boolean[N+1][M+1]; + + for(int i=1;i<=N;i++){ //배열 초기화 + st = new StringTokenizer(br.readLine()); + for(int j=1;j<=M;j++) { + board[i][j] = Integer.parseInt(st.nextToken()); + } + } + + for(int i=0;iN || newj<=0 || newj>M) continue; + total += attack(newi,newj,direction); + } + } + return total; + } +} + +```