1
2
3
4
5
6
7
8
9
10
11
12
|
def decToK(n,k):
ans=0
while n>0:
ans+=n%k
n=n//k
return ans
for i in range(1000,10000):
ten=decToK(i,10)
twe = decToK(i, 12)
six = decToK(i, 16)
if ten==twe and twe==six : print(i)
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
백준 9063 대지 (0) | 2021.11.28 |
---|---|
백준 14491 9진수 (0) | 2021.11.28 |
백준 2858 기숙사 바닥 (0) | 2021.11.19 |
백준 14782 Bedtime Reading, I (0) | 2021.11.19 |
백준 13225 Divisors (0) | 2021.11.19 |
댓글