結果

問題 No.1286 Stone Skipping
ユーザー chineristACchineristAC
提出日時 2020-11-13 22:30:34
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 87 ms / 2,000 ms
コード長 401 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 87,312 KB
実行使用メモリ 76,780 KB
最終ジャッジ日時 2023-09-30 16:08:34
合計ジャッジ時間 3,890 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
76,004 KB
testcase_01 AC 78 ms
75,740 KB
testcase_02 AC 84 ms
76,176 KB
testcase_03 AC 80 ms
76,468 KB
testcase_04 AC 81 ms
76,492 KB
testcase_05 AC 81 ms
76,540 KB
testcase_06 AC 80 ms
76,424 KB
testcase_07 AC 82 ms
76,460 KB
testcase_08 AC 82 ms
76,472 KB
testcase_09 AC 83 ms
76,644 KB
testcase_10 AC 82 ms
76,196 KB
testcase_11 AC 81 ms
76,492 KB
testcase_12 AC 83 ms
76,520 KB
testcase_13 AC 85 ms
76,476 KB
testcase_14 AC 84 ms
76,432 KB
testcase_15 AC 86 ms
76,572 KB
testcase_16 AC 85 ms
76,476 KB
testcase_17 AC 87 ms
76,416 KB
testcase_18 AC 77 ms
75,992 KB
testcase_19 AC 79 ms
75,912 KB
testcase_20 AC 84 ms
76,480 KB
testcase_21 AC 84 ms
76,632 KB
testcase_22 AC 84 ms
76,656 KB
testcase_23 AC 82 ms
76,464 KB
testcase_24 AC 85 ms
76,780 KB
testcase_25 AC 84 ms
76,708 KB
testcase_26 AC 84 ms
76,608 KB
testcase_27 AC 85 ms
76,376 KB
testcase_28 AC 84 ms
76,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

D = int(input())

res = D

for i in range(1,60):
    start = 0
    end = D
    while end-start>1:
        mid = (end+start)//2
        tmp = 0
        for j in range(i+1):
            tmp += mid//(2**j)
        if tmp>=D:
            end = mid
        else:
            start = mid

    tmp = 0
    for j in range(i+1):
        tmp += end//(2**j)
    if tmp==D:
        res = min(res,end)

print(res)
0