Title: 아름다운 수, Time: 44ms, Memory: 16MB, Status: Passed - Codetree
This commit is contained in:
25
251101/아름다운 수/beautiful-number.py
Normal file
25
251101/아름다운 수/beautiful-number.py
Normal file
@@ -0,0 +1,25 @@
|
||||
n = int(input())
|
||||
|
||||
# Please write your code here.
|
||||
|
||||
answer = []
|
||||
result = 0
|
||||
|
||||
def choose():
|
||||
global result
|
||||
|
||||
if len(answer) == n:
|
||||
result += 1
|
||||
return
|
||||
|
||||
if len(answer) > n:
|
||||
return
|
||||
|
||||
for i in range(1, 5):
|
||||
answer.extend([i] * i)
|
||||
choose()
|
||||
for _ in range(i):
|
||||
answer.pop()
|
||||
|
||||
choose()
|
||||
print(result)
|
||||
Reference in New Issue
Block a user