We deduce an explicit closed formula for the zeta-regularized spectral determinant of the Friedrichs Laplacian on the Riemann sphere equipped with arbitrary constant curvature (flat, spherical, or hyperbolic) metric having three conical singularities of order \(\beta _j\in (-1,0)\) (or, equivalently, of angle \(2\pi (\beta _j+1)\)). We show that among the metrics with a fixed value of the sum \(\beta _1+\beta _2+\beta _3\) and a fixed surface area, those with \(\beta _1=\beta _2=\beta _3\) correspond to a stationary point of the determinant. If, in addition, the surface area is sufficiently small, then the stationary point is a minimum. As a crucial step towards obtaining these results, we find a new anomaly formula for the determinant of Laplacian that includes (as one of its terms) the Liouville action, introduced by A. Zamolodchikov and Al. Zamolodchikov in connection with the celebrated DOZZ formula for the three-point structure constants of the Liouville field theory. The Liouville action satisfies a system of differential equations that can be easily integrated.