[프로그래머스] n진수 게임 (파이썬, 진법변환)
728x90
반응형
def solution(n, t, m, p):
answer = []
T="0123456789ABCDEF"
num="0"
for i in range(0,m*t+1):
temp=""
while i:
i,j=divmod(i,n)
temp=T[j]+temp
num=num+temp
for i in range(t*m):
if i%m==p-1:
answer.append(num[i])
return ''.join(answer)
728x90
반응형
'프로그래머스' 카테고리의 다른 글
[프로그래머스] 3진법 뒤집기 (0) | 2020.12.12 |
---|---|
[프로그래머스] 두 개 뽑아서 더하기 (python, javascript) (0) | 2020.12.12 |
[프로그래머스] 수식 최대화 (파이썬, 순열, javascript) (0) | 2020.09.24 |
[프로그래머스] 등굣길 (dp,파이썬) (0) | 2020.09.23 |
[프로그래머스] 거스름돈 (파이썬, javascript) (0) | 2020.09.23 |
TAGS.