結果

問題 No.1286 Stone Skipping
ユーザー ygd.ygd.
提出日時 2020-11-14 19:29:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 97 ms / 2,000 ms
コード長 515 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 87,108 KB
実行使用メモリ 77,260 KB
最終ジャッジ日時 2023-09-30 16:12:25
合計ジャッジ時間 4,331 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
76,656 KB
testcase_01 AC 92 ms
76,660 KB
testcase_02 AC 93 ms
76,824 KB
testcase_03 AC 91 ms
76,724 KB
testcase_04 AC 92 ms
76,604 KB
testcase_05 AC 91 ms
76,968 KB
testcase_06 AC 91 ms
76,508 KB
testcase_07 AC 91 ms
76,576 KB
testcase_08 AC 92 ms
76,980 KB
testcase_09 AC 93 ms
77,116 KB
testcase_10 AC 92 ms
76,668 KB
testcase_11 AC 90 ms
76,668 KB
testcase_12 AC 92 ms
76,808 KB
testcase_13 AC 94 ms
76,724 KB
testcase_14 AC 91 ms
76,624 KB
testcase_15 AC 92 ms
76,536 KB
testcase_16 AC 91 ms
76,880 KB
testcase_17 AC 92 ms
76,728 KB
testcase_18 AC 96 ms
76,968 KB
testcase_19 AC 97 ms
77,260 KB
testcase_20 AC 93 ms
76,972 KB
testcase_21 AC 93 ms
76,728 KB
testcase_22 AC 94 ms
76,792 KB
testcase_23 AC 93 ms
77,012 KB
testcase_24 AC 93 ms
76,548 KB
testcase_25 AC 93 ms
76,836 KB
testcase_26 AC 94 ms
76,784 KB
testcase_27 AC 92 ms
77,056 KB
testcase_28 AC 93 ms
76,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

D = int(input())
ok = pow(10,20)
ng = 0

def check(x,loop):
    ret = x
    for i in range(loop):
        x = x//2
        ret += x
    return ret

#print(check(5,1))
ans = float("inf")
MAX = 70
for i in range(MAX):
    ok = pow(10,20)
    ng = 0
    while abs(ok-ng) > 1: #and cnt < 100:
        mid = (ok+ng)//2
        #print(ok,mid,ng)
        if check(mid,i) >= D:
            ok = mid
        else:
            ng = mid
    #print(ok,check(ok,i))
    if check(ok,i) == D:
        ans = min(ans,ok)

print(ans)
0