20250928 baekjoon
This commit is contained in:
parent
f0ead9ce24
commit
b601ae8c09
27
code_study/Baekjoon/python/2448.py
Normal file
27
code_study/Baekjoon/python/2448.py
Normal file
@ -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))
|
||||||
Loading…
x
Reference in New Issue
Block a user