Let n, k, t be positive integers. What is the maximum number of arcs in a digraph on n vertices in which there are at most t distinct walks of length k with the same endpoints? In this paper, we prove that the maximum number is equal to n(n − 1)/2 and the extremal digraph are the transitive tournaments when k ≥ n − 1 ≥ max{2t + 1, 2 2t + 9/4 + 1/2 + 3}. Based on this result, we may determine the maximum numbers and the extremal digraphs for k ≥ max{2t + 1, 2 2t + 9/4 + 1/2 + 3} and n is sufficiently large, which generalises the existing results. A conjecture is also presented.