In this paper, we consider the problem of numerical investigation of the counting statistics for a class of one-dimensional systems. Importance sampling, the cornerstone technique usually implemented for such problems, critically hinges on selecting an appropriate biased distribution. While an exponential tilt in the observable stands as the conventional choice for various problems, its efficiency in the context of counting statistics may be significantly hindered by the genuine discreteness of the observable. To address this challenge, we propose an alternative strategy, which we call importance sampling with the local tilt. We demonstrate the efficiency of the proposed approach through the analysis of three prototypical examples: a set of independent Gaussian random variables, Dyson gas, and symmetric simple exclusion process with a steplike initial condition.