2018 KAKAO BLIND RECRUITMENT
def solution(n, t, m, p):
answer = ''
for num in range(1, t*m):
res=''
while num>0:
num,mod=divmod(num,n)
if 10<=mod<=15:
mod=chr(ord('A')-10+mod) #55+mod
res+=str(mod)
answer+=res[::-1]
answer='0'+answer
result=answer[p-1::m][:t]
return result
'IT > coding study' 카테고리의 다른 글
[acmicpc] 3020. 개똥벌레 (python) (0) | 2022.03.10 |
---|---|
[acmicpc] 3190. 뱀 (python) (0) | 2022.03.07 |
[programmers] [3차] 압축 (python) (0) | 2022.01.18 |
[programmers] [3차] 방금그곡 (python) (0) | 2022.01.17 |
[programmers] 크레인 인형뽑기 게임 (python) (0) | 2022.01.10 |