Ground-state energy of a two-dimensional charge-density-wave state in a strong magnetic field