結果

問題 No.3 ビットすごろく
ユーザー edash
提出日時 2018-08-19 16:39:37
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 226 bytes
コンパイル時間 457 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 21,248 KB
最終ジャッジ日時 2024-11-17 13:20:33
合計ジャッジ時間 115,909 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 8 WA * 6 TLE * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
w = 1
count = 1
while w != n:
    steps = list(str(bin(w)))[2:]
    num = 0
    for j in steps:
        num += int(j)
    if w + num > n:
        w -= num
    else:
        w += num
    count += 1
print(count)
0