結果
問題 |
No.1132 凸凹
|
ユーザー |
![]() |
提出日時 | 2020-08-13 11:56:26 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 533 bytes |
コンパイル時間 | 323 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-10-09 19:07:05 |
合計ジャッジ時間 | 2,232 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 20 WA * 6 |
ソースコード
a,b,c,d,p,q=map(int,input().split()) def f(x): return a*x**3+b*x**2+c*x+d xmin,xmax=p,q if (b**2-3*a*c)>0 and a!=0: xmin=round(min((-b+(b**2-3*a*c))/3/a,(-b-(b**2-3*a*c))/3/a)) xmax=round(max((-b+(b**2-3*a*c))/3/a,(-b-(b**2-3*a*c))/3/a)) xmin=xmin if p<xmin and q>xmin else p xmax=xmax if p<xmax and q>xmax else q mx=xmin if f(xmin)<f(xmax) else xmax MX=xmax if f(xmin)<f(xmax) else xmin if a==0 and b!=0: x=round(c/b) mx=x if f(xmin)>f(x) else mx MX=x if f(xmax)<f(x) else MX print(f(MX),MX,f(mx),mx)