With a newly improved isospin-and momentum-dependent interaction and an isospin-dependent Boltzmann-Uehling-Uhlenbeck transport model, we have investigated the effects of the slope parameter L of the nuclear symmetry energy and the isospin splitting of the nucleon effective mass m * n−p = (m * n − m * p )/m on the centroid energy of the isovector giant dipole resonance and the electric dipole polarizability in 208 Pb. With the isoscalar nucleon effective mass m * s = 0.7m constrained by the empirical optical potential, we obtain a constraint of L = 64.29 ± 11.84(MeV) and m * n−p = (−0.019 ± 0.090)δ, with δ being the isospin asymmetry of nuclear medium. With the isoscalar nucleon effective mass m * s = 0.84m extracted from the excitation energy of the isoscalar giant quadruple resonance in 208 Pb, we obtain a constraint of L = 53.85 ± 10.29(MeV) and m * n−p = (0.216 ± 0.114)δ.