結果
| 問題 | No.3 ビットすごろく |
| コンテスト | |
| ユーザー |
lightnet328
|
| 提出日時 | 2017-07-01 16:00:27 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 468 bytes |
| 記録 | |
| コンパイル時間 | 55 ms |
| コンパイル使用メモリ | 14,720 KB |
| 実行使用メモリ | 14,208 KB |
| 最終ジャッジ日時 | 2026-09-10 12:14:17 |
| 合計ジャッジ時間 | 7,357 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 11 RE * 15 OLE * 2 |
ソースコード
import sys
def popcnt(n):
return len(list(filter(lambda c: c == '1', list(str(bin(n))))))
def mov(e, p = 1, t = []):
if p in t or p > e or p < 1:
print(e, p, t, "E")
return -1
q = popcnt(p)
t.append(p)
if p == e:
print(len(t))
sys.exit(0)
r = list(filter(lambda i: i >= 0, [mov(e, p + q, t), mov(e, p - q, t)]))
if len(r) > 0:
return min(r)
else:
return -1
print(mov(int(input())))
lightnet328