結果

問題 No.1286 Stone Skipping
ユーザー ayaoniayaoni
提出日時 2020-11-13 23:47:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 85 ms / 2,000 ms
コード長 316 bytes
コンパイル時間 256 ms
コンパイル使用メモリ 86,884 KB
実行使用メモリ 76,108 KB
最終ジャッジ日時 2023-09-30 16:09:33
合計ジャッジ時間 3,640 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,348 KB
testcase_01 AC 71 ms
71,004 KB
testcase_02 AC 81 ms
75,824 KB
testcase_03 AC 72 ms
70,976 KB
testcase_04 AC 72 ms
70,940 KB
testcase_05 AC 72 ms
70,964 KB
testcase_06 AC 71 ms
71,164 KB
testcase_07 AC 72 ms
71,236 KB
testcase_08 AC 76 ms
76,108 KB
testcase_09 AC 76 ms
76,016 KB
testcase_10 AC 77 ms
76,108 KB
testcase_11 AC 75 ms
75,820 KB
testcase_12 AC 76 ms
75,796 KB
testcase_13 AC 81 ms
75,864 KB
testcase_14 AC 80 ms
76,000 KB
testcase_15 AC 81 ms
75,892 KB
testcase_16 AC 82 ms
76,004 KB
testcase_17 AC 85 ms
76,012 KB
testcase_18 AC 71 ms
70,940 KB
testcase_19 AC 71 ms
71,176 KB
testcase_20 AC 82 ms
75,772 KB
testcase_21 AC 81 ms
75,912 KB
testcase_22 AC 78 ms
75,880 KB
testcase_23 AC 78 ms
76,024 KB
testcase_24 AC 84 ms
75,964 KB
testcase_25 AC 83 ms
75,996 KB
testcase_26 AC 81 ms
75,892 KB
testcase_27 AC 82 ms
75,900 KB
testcase_28 AC 82 ms
75,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
def I(): return int(sys.stdin.readline().rstrip())


D = I()
l = D.bit_length()

ans = D
a = 2
for i in range(1,l):
    x = (a*D+2*a-2)//(2*a-1)
    y = (a*(D+i)-1)//(2*a-1)
    for j in range(x,y+1):
        if sum(j//(2**k) for k in range(i+1)) == D:
            ans = min(ans,j)
    a *= 2

print(ans)
0