結果

問題 No.3 ビットすごろく
ユーザー dangodango
提出日時 2023-06-14 21:07:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 104 ms / 5,000 ms
コード長 252 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 87,104 KB
実行使用メモリ 77,264 KB
最終ジャッジ日時 2023-09-05 06:54:59
合計ジャッジ時間 4,753 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,484 KB
testcase_01 AC 75 ms
71,076 KB
testcase_02 AC 75 ms
71,120 KB
testcase_03 AC 93 ms
76,532 KB
testcase_04 AC 86 ms
76,420 KB
testcase_05 AC 100 ms
77,044 KB
testcase_06 AC 94 ms
76,540 KB
testcase_07 AC 89 ms
76,372 KB
testcase_08 AC 95 ms
76,552 KB
testcase_09 AC 99 ms
76,872 KB
testcase_10 AC 99 ms
77,028 KB
testcase_11 AC 98 ms
77,128 KB
testcase_12 AC 100 ms
76,892 KB
testcase_13 AC 94 ms
76,480 KB
testcase_14 AC 102 ms
76,944 KB
testcase_15 AC 102 ms
77,184 KB
testcase_16 AC 102 ms
76,988 KB
testcase_17 AC 104 ms
76,988 KB
testcase_18 AC 95 ms
76,260 KB
testcase_19 AC 102 ms
77,120 KB
testcase_20 AC 80 ms
71,268 KB
testcase_21 AC 77 ms
71,192 KB
testcase_22 AC 103 ms
76,920 KB
testcase_23 AC 102 ms
77,108 KB
testcase_24 AC 99 ms
77,264 KB
testcase_25 AC 100 ms
77,264 KB
testcase_26 AC 77 ms
71,548 KB
testcase_27 AC 92 ms
76,660 KB
testcase_28 AC 102 ms
76,872 KB
testcase_29 AC 99 ms
76,776 KB
testcase_30 AC 77 ms
71,332 KB
testcase_31 AC 79 ms
71,268 KB
testcase_32 AC 98 ms
76,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

A = N = int(input()) + 1
L, C, R = [1], 0, {}
while C < A:
  Q = L
  L =[]
  C += 1
  for i in Q:
    B = bin(i).count('1')
    A = [A, C][i == N - 1]
    L = [L + [i + B] * (i + B < N) + [i - B] * (i > B), L][i in R]
    R[i] = 1
print([-1, A][A < N])
0