Skip to content

Latest commit

 

History

History
35 lines (30 loc) · 730 Bytes

16505.md

File metadata and controls

35 lines (30 loc) · 730 Bytes

백준 16505번 별

16505


소스코드

  • 메모리 : 36912 KB
  • 시간 : 456 ms
def star(n,x,y):
    if n == 1: 
        board[x][y] = '*'
        return
    m = n // 2
    star(m,x,y)
    star(m,x+m,y)
    star(m,x,y+m)
    
n = int(input())
size = 2**n
board = [[False]*size for i in range(size)]
for i in range(size):
    for j in range(size):
        board[i][j] = ' '
star(size,0,0)
for i in range(size):
    for j in range(size-i):
        print(board[i][j], end = "")
    if i != size-1:
        print("\n", end = "")