Arithmetic mean of the sequence

Authors

  • Pavel Töpfer Faculty of Mathematics and Physics, Charles University, Prague

Abstract

The article from the series dedicated to problems of Mathematical Olympiad – category P (programming) discusses different solutions of one competition problem from the regional round of the 2013/14 school year. The task is to find in a sequence of numbers the longest continuous section whose arithmetic mean is equal to the specified value. The article demonstrates various programming techniques that can be used to increase the time efficiency of a solution, such as pre-calculation, prefix sums, or appropriate data sorting. Besides the detailed analysis of the problem, we find in the article three basic variants of the solution written in the form of a sample program.

Published

2019-01-28

How to Cite

Töpfer, P. (2019). Arithmetic mean of the sequence. MATHEMATICS–PHYSICS–INFORMATICS, 28(1), 67–73. Retrieved from https://mfi.upol.cz/index.php/mfi/article/view/443

Issue

Section

Informatics