結果
問題 |
No.2970 三次関数の絶対値
|
ユーザー |
👑 |
提出日時 | 2024-05-08 01:05:10 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 30 ms / 2,000 ms |
コード長 | 378 bytes |
コンパイル時間 | 341 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-12-14 14:34:56 |
合計ジャッジ時間 | 3,038 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 50 |
ソースコード
J=lambda:map(int,input().split()) C=list(J()) L,R=J() S=[L,R] if C[3]==0: if C[2]: x=-C[1]/(2*C[2]) if L<=x<=R:S+=[x] else: D=C[2]**2-3*C[1]*C[3] if D>=0: d=D**0.5 for s in[-1,1]: x=(-C[2]+d*s)/(3*C[3]) if L<=x<=R:S+=[x] a=9**9 s=set() for x in S: y=C[0]+(C[1]+(C[2]+C[3]*x)*x)*x s.add([[0,-1][y<0],1][y>0]) a=min(a,abs(y)) if len(s)<2:print(a) else:print(0)