結果

問題 No.3 ビットすごろく
ユーザー eiji1000
提出日時 2019-03-08 13:55:00
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 287 bytes
コンパイル時間 378 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-06-23 15:01:03
合計ジャッジ時間 2,578 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 RE * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

position = 1
counter = 1

while position < n:
    # binary step
    p_b = bin(position)
    p_b_ones = p_b.conut('1')
    # update position
    position += p_b_ones
    counter +=1
    

if n == 1:
    print(1)
elif n == position:
    print(counter)
else:
    print(-1)
0