結果

問題 No.1286 Stone Skipping
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2023-11-17 10:47:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 59 ms / 2,000 ms
コード長 514 bytes
コンパイル時間 162 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 68,476 KB
最終ジャッジ日時 2023-11-17 10:47:17
合計ジャッジ時間 3,752 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
61,692 KB
testcase_01 AC 48 ms
61,692 KB
testcase_02 AC 56 ms
66,284 KB
testcase_03 AC 49 ms
63,804 KB
testcase_04 AC 50 ms
63,804 KB
testcase_05 AC 50 ms
63,804 KB
testcase_06 AC 51 ms
63,804 KB
testcase_07 AC 50 ms
63,804 KB
testcase_08 AC 54 ms
66,284 KB
testcase_09 AC 55 ms
66,284 KB
testcase_10 AC 55 ms
66,284 KB
testcase_11 AC 53 ms
66,284 KB
testcase_12 AC 54 ms
66,284 KB
testcase_13 AC 56 ms
66,284 KB
testcase_14 AC 55 ms
66,284 KB
testcase_15 AC 57 ms
66,284 KB
testcase_16 AC 56 ms
66,284 KB
testcase_17 AC 59 ms
68,476 KB
testcase_18 AC 47 ms
61,692 KB
testcase_19 AC 47 ms
61,692 KB
testcase_20 AC 56 ms
66,284 KB
testcase_21 AC 56 ms
66,284 KB
testcase_22 AC 55 ms
66,408 KB
testcase_23 AC 54 ms
66,284 KB
testcase_24 AC 55 ms
66,284 KB
testcase_25 AC 57 ms
68,460 KB
testcase_26 AC 55 ms
66,284 KB
testcase_27 AC 56 ms
66,284 KB
testcase_28 AC 57 ms
66,284 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0