結果

問題 No.1286 Stone Skipping
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2020-11-14 09:59:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 415 bytes
コンパイル時間 1,004 ms
コンパイル使用メモリ 87,256 KB
実行使用メモリ 76,220 KB
最終ジャッジ日時 2023-09-30 16:11:55
合計ジャッジ時間 4,179 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,452 KB
testcase_01 AC 73 ms
71,288 KB
testcase_02 AC 88 ms
76,020 KB
testcase_03 AC 83 ms
75,552 KB
testcase_04 AC 78 ms
75,864 KB
testcase_05 AC 79 ms
75,568 KB
testcase_06 AC 77 ms
75,640 KB
testcase_07 AC 77 ms
75,836 KB
testcase_08 AC 80 ms
75,844 KB
testcase_09 AC 81 ms
76,012 KB
testcase_10 AC 80 ms
75,800 KB
testcase_11 AC 82 ms
76,020 KB
testcase_12 AC 80 ms
76,096 KB
testcase_13 AC 83 ms
76,220 KB
testcase_14 AC 83 ms
76,020 KB
testcase_15 AC 80 ms
76,012 KB
testcase_16 AC 82 ms
75,804 KB
testcase_17 AC 82 ms
76,008 KB
testcase_18 AC 74 ms
71,456 KB
testcase_19 AC 74 ms
71,240 KB
testcase_20 AC 81 ms
76,136 KB
testcase_21 AC 83 ms
76,028 KB
testcase_22 AC 81 ms
76,192 KB
testcase_23 AC 84 ms
75,996 KB
testcase_24 AC 84 ms
75,996 KB
testcase_25 AC 86 ms
76,028 KB
testcase_26 AC 82 ms
76,024 KB
testcase_27 AC 82 ms
76,020 KB
testcase_28 AC 82 ms
76,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

d = int(input())

ans = d

def calc(x,n):
    count = 0
    i = n
    while x and i:
        count += x
        x //= 2
        i -= 1
        if count >= d:
            break
    return count

for i in range(1,70):
    l = 0
    r = d+1
    while r > l + 1:
        m = (r+l)//2
        if calc(m,i) >= d:
            r = m
        else:
            l = m
    if calc(r,i) == d:
        ans = min(ans,r)
print(ans)
0