diff --git "a/lkhyun/202503/23 BOJ G5 \353\271\227\353\254\274.md" "b/lkhyun/202503/23 BOJ G5 \353\271\227\353\254\274.md" new file mode 100644 index 00000000..8a093d4c --- /dev/null +++ "b/lkhyun/202503/23 BOJ G5 \353\271\227\353\254\274.md" @@ -0,0 +1,54 @@ +```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 H = 0; + static int W = 0; + static int[] world; + static int answer = 0; + public static void main(String[] args) throws Exception { + st = new StringTokenizer(br.readLine()); + H = Integer.parseInt(st.nextToken()); + W = Integer.parseInt(st.nextToken()); + world = new int[W]; + + st = new StringTokenizer(br.readLine()); + for(int i=0;i world[k]) { + left = i; + break; + } + } + int right = 0; + for(int i=1;i world[k]) { + right = i; + break; + } + } + if(left!=0 && right!=0){ + if(world[k]