結果

問題 No.3 ビットすごろく
ユーザー R NR N
提出日時 2020-07-28 16:02:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 422 bytes
コンパイル時間 200 ms
コンパイル使用メモリ 10,836 KB
実行使用メモリ 8,760 KB
最終ジャッジ日時 2023-09-11 06:32:35
合計ジャッジ時間 28,827 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,976 KB
testcase_01 AC 17 ms
7,768 KB
testcase_02 AC 16 ms
7,764 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 1,907 ms
8,568 KB
testcase_06 AC 466 ms
8,280 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 1,802 ms
8,604 KB
testcase_13 AC 276 ms
8,340 KB
testcase_14 AC 4,336 ms
8,448 KB
testcase_15 TLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
権限があれば一括ダウンロードができます

ソースコード

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