結果
問題 |
No.1286 Stone Skipping
|
ユーザー |
|
提出日時 | 2023-11-17 10:47:12 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 80 ms / 2,000 ms |
コード長 | 514 bytes |
コンパイル時間 | 739 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 67,968 KB |
最終ジャッジ日時 | 2024-09-26 05:18:48 |
合計ジャッジ時間 | 3,571 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 |
ソースコード
from collections import * from itertools import * from functools import * from heapq import * import sys,math input = sys.stdin.readline D = int(input()) ans = D def f(k,x): tmp = 0 for i in range(k): tmp += (x//pow(2,i)) return tmp for i in range(1,61): y = D+1 x = 0 while y-x>1: mid = (y+x)//2 if f(i,mid)>=D: y = mid else: x = mid if f(i,y)==D: ans = min(ans,y) print(ans)