結果
| 問題 | No.3 ビットすごろく |
| コンテスト | |
| ユーザー |
moguoosan
|
| 提出日時 | 2016-08-24 16:09:40 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 401 bytes |
| 記録 | |
| コンパイル時間 | 59 ms |
| コンパイル使用メモリ | 14,848 KB |
| 実行使用メモリ | 11,520 KB |
| 最終ジャッジ日時 | 2026-09-21 00:44:32 |
| 合計ジャッジ時間 | 2,594 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 WA * 15 |
ソースコード
def fnc(s):
t = list(map(str,range(1,s+1)))
pos = 0
count = 1
li = []
while t[pos] != t[-1]:
b = bin(int(t[pos]))
tmp = str(b).count("1")
if pos + tmp > len(t)-1:
pos -= tmp
else :
pos += tmp
if t[pos] in li:
return -1
count += 1
li.append(t[pos])
return count
print(fnc(int(input())))
moguoosan