diff --git "a/khj20006/202508/02 BOJ P4 \355\221\270\354\225\231\354\235\264\354\231\200 \353\240\210\353\262\250\354\227\205.md" "b/khj20006/202508/02 BOJ P4 \355\221\270\354\225\231\354\235\264\354\231\200 \353\240\210\353\262\250\354\227\205.md" new file mode 100644 index 00000000..2658e044 --- /dev/null +++ "b/khj20006/202508/02 BOJ P4 \355\221\270\354\225\231\354\235\264\354\231\200 \353\240\210\353\262\250\354\227\205.md" @@ -0,0 +1,174 @@ +```java +import java.util.*; +import java.io.*; + +class IOController { + BufferedReader br; + BufferedWriter bw; + StringTokenizer st; + + public IOController() { + br = new BufferedReader(new InputStreamReader(System.in)); + bw = new BufferedWriter(new OutputStreamWriter(System.out)); + st = new StringTokenizer(""); + } + + String nextLine() throws Exception { + String line = br.readLine(); + st = new StringTokenizer(line); + return line; + } + + String nextToken() throws Exception { + while (!st.hasMoreTokens()) nextLine(); + return st.nextToken(); + } + + int nextInt() throws Exception { + return Integer.parseInt(nextToken()); + } + + long nextLong() throws Exception { + return Long.parseLong(nextToken()); + } + + double nextDouble() throws Exception { + return Double.parseDouble(nextToken()); + } + + void close() throws Exception { + bw.flush(); + bw.close(); + } + + void write(String content) throws Exception { + bw.write(content); + } + +} + +public class Main { + + static IOController io; + + // + + static int N; + static long R; + static int[][] a; + + public static void main(String[] args) throws Exception { + + io = new IOController(); + + init(); + solve(); + + io.close(); + + } + + static void init() throws Exception { + + N = io.nextInt(); + R = io.nextLong(); + a = new int[N][N]; + for(int i=0;i>1; + while(s[] deques = new Deque[N]; + for(int i=0;i(); + + for(int i=0;i deque = new ArrayDeque<>(); + for(int j=0;j= K) deques[j].pollFirst(); + if(i >= K-1) rowMax[i-K+1][j] = deques[j].peekFirst()[0]; + + } + } + for(int i=N-K+1;i(); + + for(int j=0;j deque = new ArrayDeque<>(); + for(int i=0;i= K) deques[i].pollFirst(); + if(j >= K-1) colMax[i][j-K+1] = deques[i].peekFirst()[0]; + } + } + for(int i=0;i= R) e = m; + else s = m+1; + m = (s+e)>>1; + + } + io.write(m + "\n"); + + } + +} +```