본문 바로가기
python-algorithm

[백준] 3460

by 무적김두칠 2020. 12. 23.

1
2
3
4
5
6
7
8
9
10
11
12
import sys
t=int(sys.stdin.readline())
for _ in  range(t):
    n=int(sys.stdin.readline())
    tmp=[]
    while n//2!=0:
        tmp.append(n%2)
        n=n//2
    tmp.append(n%2)
    #print (tmp)
    for i in range(len(tmp)):
        if tmp[i]==1: s=print(i,end=' ')   
cs
반응형

'python-algorithm' 카테고리의 다른 글

[백준] 4101  (0) 2020.12.23
[백준] 3486  (0) 2020.12.23
[백준] 3058  (0) 2020.12.23
[백준] 3028  (0) 2020.12.23
[백준] 3009  (0) 2020.12.22

댓글