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; + } +} + +```