結果

問題 No.1286 Stone Skipping
ユーザー AEnAEn
提出日時 2022-11-24 21:57:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 52 ms / 2,000 ms
コード長 394 bytes
コンパイル時間 162 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 63,488 KB
最終ジャッジ日時 2024-04-08 18:55:17
合計ジャッジ時間 3,357 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
62,848 KB
testcase_01 AC 49 ms
61,956 KB
testcase_02 AC 50 ms
62,848 KB
testcase_03 AC 49 ms
62,592 KB
testcase_04 AC 47 ms
62,208 KB
testcase_05 AC 47 ms
62,208 KB
testcase_06 AC 48 ms
62,592 KB
testcase_07 AC 48 ms
62,464 KB
testcase_08 AC 48 ms
62,848 KB
testcase_09 AC 48 ms
62,592 KB
testcase_10 AC 49 ms
63,104 KB
testcase_11 AC 48 ms
62,848 KB
testcase_12 AC 49 ms
62,848 KB
testcase_13 AC 50 ms
62,848 KB
testcase_14 AC 49 ms
62,592 KB
testcase_15 AC 47 ms
62,848 KB
testcase_16 AC 47 ms
62,592 KB
testcase_17 AC 49 ms
62,848 KB
testcase_18 AC 47 ms
61,824 KB
testcase_19 AC 47 ms
61,952 KB
testcase_20 AC 47 ms
62,080 KB
testcase_21 AC 47 ms
62,080 KB
testcase_22 AC 49 ms
63,488 KB
testcase_23 AC 47 ms
62,592 KB
testcase_24 AC 48 ms
62,848 KB
testcase_25 AC 47 ms
62,848 KB
testcase_26 AC 48 ms
62,592 KB
testcase_27 AC 47 ms
62,592 KB
testcase_28 AC 48 ms
62,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

D = int(input())

def judge(l,cnt):
    m = l
    dis = l
    for i in range(cnt):
        dis += m//2
        m //= 2
    return dis
res = D
for i in range(1,61):
    ok, ng = 10**18+1,0
    while ok-ng>1:
        mid = (ok+ng)//2
        dis = judge(mid,i)
        if dis>=D:
            ok = mid
        else:
            ng = mid
    if judge(ok,i)==D:
        res = min(res,ok)
print(res)
0