結果

問題 No.1286 Stone Skipping
ユーザー lllllll88938494
提出日時 2023-04-28 14:44:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 44 ms / 2,000 ms
コード長 364 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 62,592 KB
最終ジャッジ日時 2024-11-17 14:54:47
合計ジャッジ時間 2,042 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

d = int(input())


def  cal(a):
    cnt = 0
    for i in range(k):
        cnt += a
        a//=2
    return cnt

ans = d
for k in range(65):
    ng = 0
    ok = d
    while ok - ng > 1:
        mid = (ok + ng)//2
        t=cal(mid)
        if  t >= d:
            ok = mid
        else:
            ng = mid
    if cal(ok) == d:
    	ans = min(ans,ok)

print(ans)
0