結果
| 問題 | No.3 ビットすごろく |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-03-08 14:02:06 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 287 bytes |
| コンパイル時間 | 140 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-06-23 15:01:10 |
| 合計ジャッジ時間 | 2,096 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 WA * 18 |
ソースコード
n = int(input())
position = 1
counter = 1
while position < n:
# binary step
p_b = bin(position)
p_b_ones = p_b.count('1')
# update position
position += p_b_ones
counter +=1
if n == 1:
print(1)
elif n == position:
print(counter)
else:
print(-1)