Uniqueness and exact multiplicity of solutions for a class of Dirichlet problems