結果
| 問題 | No.1286 Stone Skipping |
| コンテスト | |
| ユーザー |
ygd.
|
| 提出日時 | 2020-11-14 19:29:22 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 66 ms / 2,000 ms |
| コード長 | 515 bytes |
| コンパイル時間 | 158 ms |
| コンパイル使用メモリ | 82,016 KB |
| 実行使用メモリ | 76,408 KB |
| 最終ジャッジ日時 | 2024-07-23 09:58:03 |
| 合計ジャッジ時間 | 2,950 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
ソースコード
D = int(input())
ok = pow(10,20)
ng = 0
def check(x,loop):
ret = x
for i in range(loop):
x = x//2
ret += x
return ret
#print(check(5,1))
ans = float("inf")
MAX = 70
for i in range(MAX):
ok = pow(10,20)
ng = 0
while abs(ok-ng) > 1: #and cnt < 100:
mid = (ok+ng)//2
#print(ok,mid,ng)
if check(mid,i) >= D:
ok = mid
else:
ng = mid
#print(ok,check(ok,i))
if check(ok,i) == D:
ans = min(ans,ok)
print(ans)
ygd.