From 7633c8e01789d7f924f60a3e7a6e7fdd41b681e2 Mon Sep 17 00:00:00 2001 From: LiiNi-coder <97495437+LiiNi-coder@users.noreply.github.com> Date: Tue, 25 Nov 2025 15:52:22 +0900 Subject: [PATCH] =?UTF-8?q?[20251125]=20BOJ=20/=20G3=20/=20=EC=9B=90?= =?UTF-8?q?=EC=88=AD=EC=9D=B4=20=EC=8A=A4=ED=8F=AC=EC=B8=A0=20/=20?= =?UTF-8?q?=EC=9D=B4=EC=9D=B8=ED=9D=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...4 \354\212\244\355\217\254\354\270\240.md" | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 "LiiNi-coder/202511/25 BOJ \354\233\220\354\210\255\354\235\264 \354\212\244\355\217\254\354\270\240.md" diff --git "a/LiiNi-coder/202511/25 BOJ \354\233\220\354\210\255\354\235\264 \354\212\244\355\217\254\354\270\240.md" "b/LiiNi-coder/202511/25 BOJ \354\233\220\354\210\255\354\235\264 \354\212\244\355\217\254\354\270\240.md" new file mode 100644 index 00000000..4846d0df --- /dev/null +++ "b/LiiNi-coder/202511/25 BOJ \354\233\220\354\210\255\354\235\264 \354\212\244\355\217\254\354\270\240.md" @@ -0,0 +1,45 @@ +```java +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.*; + +public class Main{ + private static int N; + private static char[] Arr; + public static void main(String[] args) throws IOException { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + N = Integer.parseInt(br.readLine()); + Arr = new char[N]; + Deque q = new ArrayDeque<>(); + Deque buffer = new ArrayDeque<>(); + q.add(new int[]{0, N/2, 0}); + q.add(new int[]{N/2, N, 1}); + for(int i = 0; i<7; i++){ + while(!q.isEmpty()){ + int[] temp = q.poll(); + int s = temp[0]; int e = temp[1]; int isB = temp[2]; + putString(s, e, isB); + + if(s + 1 < e){ + buffer.add(new int[]{s, (s + e)/2, 0}); + buffer.add(new int[]{(s + e)/2, e, 1}); + } + } + while(!buffer.isEmpty()){ + q.add(buffer.poll()); + } + System.out.println(String.valueOf(Arr)); + } + // putString(0, N/2, false)+putString(N/2, N, true); // (0, N/2, false), (N/2, N, true) + // putString(0, N/4, false) + putString(N/4, N/2, true) + + br.close(); + } + + private static void putString(int start, int end, int isB){ + for(int i = start; i