Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. This problem is actually a lot more trivial than it seems. No knowledge of quadratics is needed.
  2.  
  3. Note that the problems gives us unneeded information through the second root. Only one root is needed.
  4.  
  5. We split the problem into three cases: when a is unknown, when b is unknown, and when c is unknown.
  6.  
  7. When a is unknown, solve for a by algebraic manipulation. a = (-bx-c)/x^2
  8.  
  9. b = (-ax^2-c)/x
  10.  
  11. c = -ax^2-bx
  12.  
  13. The input for this problem is slightly awkward. Iterate through the string and have flags to indicate which coefficient you are currently on.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement