結果
| 問題 |
No.2970 三次関数の絶対値
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-11-29 21:35:59 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 379 ms / 2,000 ms |
| コード長 | 275 bytes |
| コンパイル時間 | 181 ms |
| コンパイル使用メモリ | 81,792 KB |
| 実行使用メモリ | 76,544 KB |
| 最終ジャッジ日時 | 2024-11-29 21:36:23 |
| 合計ジャッジ時間 | 19,736 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 50 |
ソースコード
import random
C = list(map(int, input().split()))
L, R = map(int, input().split())
def f(x):
return abs(C[0] + C[1] * x + C[2] * x * x + C[3] * x * x * x)
ans = 1 << 60
for _ in range(10 ** 7):
x = random.random() * (R - L) + L
ans = min(ans, f(x))
print(ans)