957C

题意:

给你一个数列 E,E1<E2<E3<...<En E , 保 证 E 1 < E 2 < E 3 < . . . < E n 。
请你选出3个数 Ei<Ej<Ek(EkEi<=U),使η=EkEjEkEi E i < E j < E k ( E k − E i <= U ) , 使 得 η = E k − E j E k − E i 最 大

输入格式:

第一行2个整数n和U (3n105,1U109) ( 3   ≤   n   ≤   10 5 , 1   ≤   U   ≤   10 9 ) ,表示数列元素个数和题意中的U
第二行包含n个整数 E1,E2,...,En(1E1<E2...<En109) E 1 ,   E 2 ,   . . . ,   E n ( 1   ≤   E 1   <   E 2 . . .   <   E n   ≤   10 9 )

输出格式:

仅一行,若不存在 η η 则输出-1,否则输出最大的 η(109) η ( 与 标 准 答 案 误 差 小 于 10 − 9 即 为 正 确 )
建议输出保留小数位数10位以上

样例:

input
4 4
1 3 5 7
output
0.5
inputCopy
10 8
10 13 15 16 17 19 20 22 24 25
output
0.875
inputCopy
3 1
2 5 10
output
-1

note:

在第一个样例中,选择E1,E2 and E3, η=5351=0.5 η = 5 − 3 5 − 1 = 0.5 .

在第二个样例中,选择E4, E5 and E9, η=24172416=0.875 η = 24 − 17 24 − 16 = 0.875 .

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
C:\Users\张豪>pip install matplotlib-3.7.2-cp310-cp310-win32.whl Processing c:\users\张豪\matplotlib-3.7.2-cp310-cp310-win32.whl Collecting contourpy>=1.0.1 (from matplotlib==3.7.2) Using cached contourpy-1.1.0.tar.gz (13.4 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [12 lines of output] + meson setup C:\Users\张豪\AppData\Local\Temp\pip-install-9aonnup5\contourpy_cf94fc4320674b1ab97a527e0a04f957 C:\Users\张豪\AppData\Local\Temp\pip-install-9aonnup5\contourpy_cf94fc4320674b1ab97a527e0a04f957\.mesonpy-k9vixjo_\build -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --vsenv --native-file=C:\Users\张豪\AppData\Local\Temp\pip-install-9aonnup5\contourpy_cf94fc4320674b1ab97a527e0a04f957\.mesonpy-k9vixjo_\build\meson-python-native-file.ini The Meson build system Version: 1.2.0 Source dir: C:\Users\张豪\AppData\Local\Temp\pip-install-9aonnup5\contourpy_cf94fc4320674b1ab97a527e0a04f957 Build dir: C:\Users\张豪\AppData\Local\Temp\pip-install-9aonnup5\contourpy_cf94fc4320674b1ab97a527e0a04f957\.mesonpy-k9vixjo_\build Build type: native build Project name: contourpy Project version: 1.1.0 ..\..\meson.build:1:0: ERROR: Could not find C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe A full log can be found at C:\Users\张豪\AppData\Local\Temp\pip-install-9aonnup5\contourpy_cf94fc4320674b1ab97a527e0a04f957\.mesonpy-k9vixjo_\build\meson-logs\meson-log.txt [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details.
07-23
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值