結果
問題 |
No.2970 三次関数の絶対値
|
ユーザー |
👑 |
提出日時 | 2024-05-08 01:03:04 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 43 ms / 2,000 ms |
コード長 | 378 bytes |
コンパイル時間 | 437 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 52,608 KB |
最終ジャッジ日時 | 2024-12-14 14:35:11 |
合計ジャッジ時間 | 3,799 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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)