結果

問題 No.3 ビットすごろく
ユーザー R N
提出日時 2020-07-28 16:02:41
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 422 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 16,768 KB
最終ジャッジ日時 2024-06-28 20:44:20
合計ジャッジ時間 17,253 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5 WA * 5 TLE * 1 -- * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding:utf-8

N = int(input())
L = []
for i in range(N):
    L.append(i)
    
n = list()
for i in range(1,len(L)+1):
    if 1 <= i <= 3:
        n.append(i)
    elif i in [j + bin(j).count('1') for j in n]:
        n.append(i)
    elif i % 11 == 0:
        n.append(i)
    else:
        continue

if N in n and N % 11 != 0:
    print(n.index(N)+1)
elif N in n and N % 11 == 0:
    print(n.index(N)+3)
else:
    print(-1)
0