We give a solution of the problem on trigonometric polynomials f n with the given leading harmonic y cos nt that deviate the least from zero in measure, more precisely, with respect to the functional µ( f n ) = mes{t ∈ [0, 2π] : | f n (t)| ≥ 1}. For trigonometric polynomials with a fixed leading harmonic, we consider the least uniform deviation from zero on a compact set and find the minimal value of the deviation over compact subsets of the torus that have a given measure. We give a solution of a similar problem on the unit circle for algebraic polynomials with zeros on the circle.