Solution (source code)

= Solution
{c}

The supplementary law for the <Legendre symbol> is $(-1/p)=(-1)^{(p-1)/2}$ for odd <prime numbers> $p$. For odd integers $a,b$,
$$
\frac{ab-1}{2}=\frac{a-1}{2}+\frac{b-1}{2}+\frac{(a-1)(b-1)}2,
$$
and the last term is even. <Induction> over the <prime factors> of $Q$ therefore gives $\sum_i(p_i-1)/2\equiv(Q-1)/2\pmod2$. Consequently
$$
\boxed{\left(\frac{-1}Q\right)=\prod_i(-1)^{(p_i-1)/2}=(-1)^{(Q-1)/2}.}
$$
For $Q=1$ the exponent is zero.