結果

問題 No.1286 Stone Skipping
ユーザー rlangevinrlangevin
提出日時 2023-04-05 08:52:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 48 ms / 2,000 ms
コード長 408 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 82,424 KB
実行使用メモリ 65,372 KB
最終ジャッジ日時 2024-04-09 20:26:10
合計ジャッジ時間 2,844 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
63,296 KB
testcase_01 AC 45 ms
62,976 KB
testcase_02 AC 46 ms
64,764 KB
testcase_03 AC 45 ms
63,680 KB
testcase_04 AC 46 ms
62,860 KB
testcase_05 AC 46 ms
63,592 KB
testcase_06 AC 47 ms
64,364 KB
testcase_07 AC 46 ms
64,236 KB
testcase_08 AC 48 ms
65,372 KB
testcase_09 AC 46 ms
63,628 KB
testcase_10 AC 47 ms
63,880 KB
testcase_11 AC 47 ms
64,332 KB
testcase_12 AC 47 ms
64,236 KB
testcase_13 AC 48 ms
63,964 KB
testcase_14 AC 47 ms
63,592 KB
testcase_15 AC 47 ms
63,556 KB
testcase_16 AC 47 ms
63,784 KB
testcase_17 AC 47 ms
63,612 KB
testcase_18 AC 46 ms
63,560 KB
testcase_19 AC 46 ms
63,528 KB
testcase_20 AC 46 ms
64,388 KB
testcase_21 AC 48 ms
63,392 KB
testcase_22 AC 47 ms
64,552 KB
testcase_23 AC 47 ms
64,756 KB
testcase_24 AC 47 ms
64,088 KB
testcase_25 AC 47 ms
64,164 KB
testcase_26 AC 46 ms
63,368 KB
testcase_27 AC 47 ms
64,428 KB
testcase_28 AC 47 ms
65,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def check(m, k):
    now = m
    x = 0
    for _ in range(k):
        x += now
        now //= 2
    return x

D = int(input())
inf = 10 ** 18
ans = inf
for k in range(1, 66):
    yes = inf
    no = 0
    while yes - no != 1:
        mid = (yes + no)//2
        if check(mid, k) >= D:
            yes = mid
        else:
            no = mid
    if check(yes, k) == D:
        ans = min(ans, yes)

print(ans)
0