Step 1: Decide what three distinct roots should mean here.
A real cubic always has 3 roots in total, counting complex ones, but for the question to single out one option, three distinct roots here means three distinct REAL roots, which is the standard reading for this kind of question.
Step 2: Try the simplest case, q = 0.
If \(q=0\), the polynomial becomes \(x^3+px = x(x^2+p)\), which factors immediately.
One root is \(x=0\). The other two roots solve \(x^2+p=0\), that is \(x^2=-p\).
For these to be real and different from each other and from 0, we need \(-p>0\), that is \(p<0\).
When \(p<0\), the three roots are \(0\), \(\sqrt{-p}\) and \(-\sqrt{-p}\), all different from each other since \(\sqrt{-p}\neq0\).
Step 3: Check that p must be negative in general, not just for q = 0.
Look at the derivative: \(\dfrac{d}{dx}(x^3+px+q) = 3x^2+p\).
If \(p \geq 0\), then \(3x^2+p \geq 0\) for every real \(x\). That makes \(x^3+px+q\) a non-decreasing function of \(x\), so it can cross zero at most once. A function that only crosses zero once cannot have three distinct real roots.
So three distinct real roots are only possible when \(p<0\): this makes the derivative negative near \(x=0\), so the graph rises, dips down, then rises again, crossing the x-axis three times for a suitable \(q\).
Step 4: Match with the options.
Among the choices \(-1, 0, 1, 2\), only \(-1\) is negative. We already showed \(p=-1\) works, with roots \(0, 1, -1\) when \(q=0\), since \(x^3-x=x(x-1)(x+1)\). Options \(0, 1, 2\) are all at least 0, so by Step 3 they can never give three distinct real roots for any \(q\).
Final Answer:
\[ \boxed{p=-1} \]