結果
| 問題 | No.3 ビットすごろく |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-07-18 22:32:18 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 461 bytes |
| 記録 | |
| コンパイル時間 | 59 ms |
| コンパイル使用メモリ | 15,104 KB |
| 実行使用メモリ | 11,136 KB |
| 最終ジャッジ日時 | 2026-09-18 18:56:40 |
| 合計ジャッジ時間 | 2,751 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 WA * 15 |
ソースコード
N = int(input())
array = []
for i in range(1, N):
array.append(str(bin(i))[2:].count("1"))
count = 0
position = 0
while(position != N - 1):
if(array[position] == 0):
count = -1
break
elif(position + array[position] <= N - 1):
n = array[position]
array[position] = 0
position += n
count += 1
else:
position -= array[position]
count += 1
print(count + 1 if count != -1 else count)