Distinguishability, Symmetry, and Energy Estimation: Quantum Algorithms and Complexity