Solution (source code)

= Solution

For a <smooth projective curve> $C$ of <geometric genus> $g$ and a <divisor on an algebraic curve> $D$, write $\ell(D)=h^0(C,\mathcal O_C(D))$ and let $K_C$ be a <canonical divisor>. The curve form of the <Riemann-Roch theorem> is
$$
\boxed{\ell(D)-\ell(K_C-D)=\deg D+1-g.}
$$
Here $\deg K_C=2g-2$ and $\ell(K_C)=g$. In <line bundle> form,
$$
h^0(C,\mathcal L)-h^0(C,\omega_C\otimes\mathcal L^{-1})=\deg\mathcal L+1-g.
$$
The usual curve convention is a smooth geometrically integral projective curve; geometric embedding tests may be checked after extending the ground field to an algebraic closure.