結果

問題 No.1286 Stone Skipping
ユーザー rlangevinrlangevin
提出日時 2023-04-04 12:32:16
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 420 bytes
コンパイル時間 226 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 59,516 KB
最終ジャッジ日時 2024-04-08 11:55:46
合計ジャッジ時間 3,501 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
56,916 KB
testcase_01 AC 41 ms
56,916 KB
testcase_02 AC 39 ms
56,916 KB
testcase_03 AC 42 ms
56,916 KB
testcase_04 AC 40 ms
56,916 KB
testcase_05 AC 41 ms
56,916 KB
testcase_06 AC 41 ms
56,916 KB
testcase_07 AC 41 ms
56,916 KB
testcase_08 AC 42 ms
56,916 KB
testcase_09 AC 40 ms
56,916 KB
testcase_10 AC 40 ms
56,916 KB
testcase_11 AC 41 ms
56,916 KB
testcase_12 AC 40 ms
56,916 KB
testcase_13 AC 39 ms
56,916 KB
testcase_14 AC 41 ms
56,916 KB
testcase_15 AC 41 ms
56,916 KB
testcase_16 AC 40 ms
56,916 KB
testcase_17 AC 40 ms
56,916 KB
testcase_18 AC 40 ms
56,916 KB
testcase_19 AC 41 ms
56,916 KB
testcase_20 AC 43 ms
56,916 KB
testcase_21 AC 42 ms
56,916 KB
testcase_22 AC 43 ms
59,516 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 41 ms
56,916 KB
testcase_26 AC 41 ms
56,916 KB
testcase_27 AC 42 ms
56,916 KB
testcase_28 AC 43 ms
59,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def check(m):
    now = m
    x = 0
    while now:
        x += now
        now //= 2
    return x

D = int(input())
yes = 10 ** 18
no = 0
while yes - no != 1:
    mid = (yes + no)//2
    if check(mid) >= D:
        yes = mid
    else:
        no = mid

for i in range(yes, yes + 10 ** 6):
    now = i
    x = 0
    while now:
        x += now
        now //= 2
        if x == D:
            print(i)
            exit()
0