結果

問題 No.1286 Stone Skipping
ユーザー 👑 KazunKazun
提出日時 2020-11-13 22:30:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 290 bytes
コンパイル時間 732 ms
コンパイル使用メモリ 86,776 KB
実行使用メモリ 76,456 KB
最終ジャッジ日時 2023-09-30 16:08:30
合計ジャッジ時間 4,095 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
70,876 KB
testcase_01 AC 74 ms
70,980 KB
testcase_02 AC 90 ms
76,308 KB
testcase_03 AC 74 ms
74,708 KB
testcase_04 AC 73 ms
70,932 KB
testcase_05 AC 74 ms
74,816 KB
testcase_06 AC 74 ms
74,728 KB
testcase_07 AC 74 ms
70,908 KB
testcase_08 AC 78 ms
75,024 KB
testcase_09 AC 79 ms
75,040 KB
testcase_10 AC 78 ms
74,940 KB
testcase_11 AC 78 ms
74,900 KB
testcase_12 AC 78 ms
74,952 KB
testcase_13 AC 89 ms
76,012 KB
testcase_14 AC 91 ms
76,176 KB
testcase_15 AC 89 ms
76,320 KB
testcase_16 AC 89 ms
76,304 KB
testcase_17 AC 88 ms
76,132 KB
testcase_18 AC 70 ms
70,956 KB
testcase_19 AC 71 ms
70,968 KB
testcase_20 AC 90 ms
76,016 KB
testcase_21 AC 91 ms
76,456 KB
testcase_22 AC 79 ms
75,192 KB
testcase_23 AC 82 ms
76,116 KB
testcase_24 AC 89 ms
76,452 KB
testcase_25 AC 89 ms
76,440 KB
testcase_26 AC 88 ms
76,108 KB
testcase_27 AC 87 ms
76,008 KB
testcase_28 AC 90 ms
76,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

D=int(input())
N=D.bit_length()

T=[pow(2,i) for i in range(N-1,-1,-1)]

M=D
for k in range(1,N+1):
    E=[sum(T[i:i+k]) for i in range(N)]

    S=0
    X=D

    for i in range(N):
        if E[i]<=X:
            X-=E[i]
            S+=pow(2,N-1-i)

    if X==0:
        M=min(M,S)
print(M)
0