From b601ae8c09c4e80cfdcbee51aef48d0b896cb914 Mon Sep 17 00:00:00 2001 From: songyc macbook Date: Sun, 28 Sep 2025 22:16:18 +0900 Subject: [PATCH] 20250928 baekjoon --- code_study/Baekjoon/python/2448.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 code_study/Baekjoon/python/2448.py diff --git a/code_study/Baekjoon/python/2448.py b/code_study/Baekjoon/python/2448.py new file mode 100644 index 0000000..0847fda --- /dev/null +++ b/code_study/Baekjoon/python/2448.py @@ -0,0 +1,27 @@ +def draw(N: int, before: list[str]) -> list[str] : + after = [[" "] * (2 * 2 * N - 1) for _ in range(2 * N)] + for i in range(N): + after[i][N:N+2*N-1] = before[i] + + k = 0 + for i in range(N, 2 * N): + after[i][:2*N] = before[k] + after[i][2 * N:2 * N+len(before[k])] = before[k] + k += 1 + + if 2 * N == n: + return after + + return draw(2 * N, after) + +n = int(input()) + +basic = [[" ", " ", "*", " ", " "], [" ", "*", " ", "*", " "], ["*", "*", "*", "*", "*"]] + +if n == 3: + result = basic +else: + result = draw(3, basic) + +for i in result: + print("".join(i)) \ No newline at end of file