시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 1913 1274 1117 68.360%

문제

양의 정수 n이 주어졌을 때, 이를 이진수로 나타냈을 때 1의 위치를 모두 찾는 프로그램을 작성하시오. 최하위 비트(least significant bit, lsb)의 위치는 0이다.

입력

첫째 줄에 테스트 케이스의 개수 T가 주어진다. 각 테스트 케이스는 한 줄로 이루어져 있고, n이 주어진다. (1 ≤ T ≤ 10, 1 ≤ n ≤ 106)

출력

각 테스트 케이스에 대해서, 1의 위치를 공백으로 구분해서 줄 하나에 출력한다. 위치가 낮은 것부터 출력한다.

예제 입력 1

1
13

예제 출력 1

0 2 3

힌트

W3sicHJvYmxlbV9pZCI6IjM0NjAiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWM3NzRcdWM5YzRcdWMyMTgiLCJkZXNjcmlwdGlvbiI6IjxwPlx1YzU5MVx1Yzc1OCBcdWM4MTVcdWMyMTggblx1Yzc3NCBcdWM4ZmNcdWM1YjRcdWM4NGNcdWM3NDQgXHViNTRjLCBcdWM3NzRcdWI5N2MgXHVjNzc0XHVjOWM0XHVjMjE4XHViODVjIFx1YjA5OFx1ZDBjMFx1YjBjOFx1Yzc0NCBcdWI1NGMgMVx1Yzc1OCBcdWM3MDRcdWNlNThcdWI5N2MgXHViYWE4XHViNDUwIFx1Y2MzZVx1YjI5NCBcdWQ1MDRcdWI4NWNcdWFkZjhcdWI3YThcdWM3NDQgXHVjNzkxXHVjMTMxXHVkNTU4XHVjMmRjXHVjNjI0LiBcdWNkNWNcdWQ1NThcdWM3MDQgXHViZTQ0XHVkMmI4KGxlYXN0IHNpZ25pZmljYW50IGJpdCwgbHNiKVx1Yzc1OCBcdWM3MDRcdWNlNThcdWIyOTQgMFx1Yzc3NFx1YjJlNC48XC9wPlxyXG4iLCJpbnB1dCI6IjxwPlx1Y2NhYlx1YzlmOCBcdWM5MDRcdWM1ZDAgXHVkMTRjXHVjMmE0XHVkMmI4IFx1Y2YwMFx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G5cclxuPHA+TGluZSBpLCAxICZsZTsgaSAmbGU7IGQsIHNob3VsZCBjb250YWluIGluY3JlYXNpbmcgc2VxdWVuY2Ugb2YgaW50ZWdlcnMgc2VwYXJhdGVkIGJ5IHNpbmdsZSBzcGFjZXMgLSB0aGUgcG9zaXRpb25zIG9mIDEmIzM5O3MgaW4gdGhlIGJpbmFyeSByZXByZXNlbnRhdGlvbiBvZiB0aGUgaS10aCBpbnB1dCBudW1iZXIuPFwvcD5cclxuIiwiaGludCI6IiIsIm9yaWdpbmFsIjoiMSIsInByb2JsZW1fbGFuZ19jb2RlIjoiXHVjNjAxXHVjNWI0In1d

출처

ACM-ICPC > Regionals > Europe > Central European Regional Contest > CERC 2001 PB번

  • 문제의 오타를 찾은 사람: 10_J
  • 문제를 번역한 사람: baekjoon
  • 빠진 조건을 찾은 사람: irikong