結果

問題 No.1286 Stone Skipping
コンテスト
ユーザー lllllll88938494
提出日時 2023-04-28 14:41:31
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 366 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 242 ms
コンパイル使用メモリ 85,672 KB
実行使用メモリ 67,044 KB
最終ジャッジ日時 2026-05-12 10:17:08
合計ジャッジ時間 2,343 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 15 WA * 10 RE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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,mid)


print(ans)
0