![[백준 알고리즘] 2447번 별 찍기 - 10 (Python)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FcbHEhj%2FbtqDwdOXU4B%2FAAAAAAAAAAAAAAAAAAAAADOZDDnyBcyof12s-IRRipCvbJtsdlOAVH3iLo76T8Nh%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3DHexhRkWb2mX7ok%252BSHY%252F7b396Upo%253D)
언어, 알고리즘 공부/백준2020. 4. 17. 20:41[백준 알고리즘] 2447번 별 찍기 - 10 (Python)
N = int(input()) star = [] for _ in range(N): star.append(["*" for _ in range(N)]) divide = N cnt = 0 while divide != 1: divide /= 3 cnt += 1 for n in range(cnt): # 빈칸인 인덱스 구하기 idx = [i for i in range(N) if (i // 3 ** n) % 3 == 1] for i in idx: for j in idx: star[i][j] = " " # 프린트 for _ in star: print("".join(_)) ▼ 링크 https://www.acmicpc.net/problem/2447 2447번: 별 찍기 - 10 재귀적인 패턴으로 별을 찍어 보자. N이 3..