파이썬 알고리즘 277번 | [백준 5904번] Moo game - 분할 정복, 재귀 - 푸는 중

Yunny.Log ·2022년 11월 13일
0

Algorithm

목록 보기
281/318
post-thumbnail

277. moo game

1) 어떤 전략(알고리즘)으로 해결?

2) 코딩 설명

<내 풀이>



< 내 틀렸던 풀이, 문제점>

(1) 9pro memory exceeded error 메모리 초과


import sys

n = int(sys.stdin.readline())
s = "moo"
i=1
while len(s)<n : 
    s = (str(s+ "m"+ "o"*(i+2) + s))
    if len(s)>n : 
        break
    i+=1
print(s[n-1])  

<반성 점>

<배운 점>

0개의 댓글