結果

問題 No.1286 Stone Skipping
ユーザー 👑 H20H20
提出日時 2020-11-15 16:49:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 561 bytes
コンパイル時間 1,711 ms
コンパイル使用メモリ 87,044 KB
実行使用メモリ 75,644 KB
最終ジャッジ日時 2023-09-30 07:01:15
合計ジャッジ時間 3,682 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
75,328 KB
testcase_01 AC 63 ms
75,316 KB
testcase_02 WA -
testcase_03 AC 64 ms
75,108 KB
testcase_04 WA -
testcase_05 AC 64 ms
75,252 KB
testcase_06 WA -
testcase_07 AC 68 ms
75,268 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 66 ms
75,168 KB
testcase_11 AC 65 ms
75,180 KB
testcase_12 AC 65 ms
75,164 KB
testcase_13 AC 66 ms
75,168 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 67 ms
75,484 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 66 ms
75,280 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 65 ms
75,248 KB
testcase_26 AC 64 ms
75,524 KB
testcase_27 WA -
testcase_28 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#めぐる式二部探索
#参考サイト:https://aotamasaki.hatenablog.com/entry/meguru_bisect

D = int(input())
def is_ok(arg):
    jump = 0
    while arg>0:
        jump += arg
        arg = arg//2
    return jump >= D

def meguru_bisect(ng, ok):
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(mid):
            ok = mid
        else:
            ng = mid
    return ok
ans = meguru_bisect(0,10**18 + 1)

jump = 0
anstemp = ans
while anstemp >0:
    jump += anstemp
    anstemp = anstemp//2

if jump>D: 
    ans+=1

print(ans)
0