The discussion of interesting tasks from the Czech national olympiad in informatics. The task deals with finding the longest possible segment in the sequence of numbers in which the positive and negative numbers are equally included.
The paper shows how to accelerate the calculation by selecting the appropriate data representation and using the prefix sum technique.