結果
| 問題 |
No.3 ビットすごろく
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-12-12 19:23:48 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 252 bytes |
| コンパイル時間 | 98 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 11,264 KB |
| 最終ジャッジ日時 | 2024-09-19 21:58:24 |
| 合計ジャッジ時間 | 2,330 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 WA * 16 |
ソースコード
g=int(input())
l=list(range(g+1))
b=[bin(x).count('1') for x in l]
s=[1]
x,c,a=1,0,0
for i in l:
n=x+b[x]
if n>g: n=1
p=x-b[x]
if p<1: p=1
if l[n] not in s: x=n
elif l[p] not in s: x=p
else: a=-1; break
s+=[x]
if x==g: a=len(s); break
print(a)