| 2026 Spring UT CS104c Midterm #1 |
|---|
| Закончено |
Given a cubic polynomial $$$$$$f(x) = x^3 + a x + b$$$$$$ it can be shown that if $$$a$$$ and $$$b$$$ are non-negative, then $$$f(x)$$$ has exactly one real root $$$f(r) = 0$$$. Find $$$r$$$.
The only line of input contains two real numbers $$$a$$$ and $$$b$$$ $$$(0 \leq a,b \leq 10^9)$$$.
Find the real root $$$r$$$ with $$$f(r) = 0$$$. It can be proved that exactly one such $$$r$$$ exists. Your answer will be judged correct if it matches the judge solution with absolute or relative error at most $$$10^{-6}$$$.
0 0
2.98023223876953125e-08
3.14 1000000000.0
-999.998953342059394344687461853
6.0 7.0
-0.9999999701976776123046875
Hint 1: be sure to print your answer with lots of digits after the decimal point to make sure that it is within the absolute or relative error bounds.
Hint 2: be sure to use double-precision floating point numbers (not 32-bit floats).
| Название |
|---|


