Investing in Stocks (stocks)

153 teams scored 14490 points on this task, for a maximum score of 100, an average score of 95 and a median score of 100.

Highlights

  1. Galilei, Verona is the institute with the most points (500).
  2. Lombardia is the region with the most points (2705).

Statement

An ever-increasing number of young people decides to try to make money online using live streaming platforms. Luca didn't want to miss out and a while ago started streaming gameplays, investing the earnings in his favourite company's stocks. So far N purchases have been made, some with money coming directly from the streaming service (indicated with S_i = 1), others with money coming from different sources (thus, not from the streaming: S_i = 0). Luca kept a detailed log of the value of the stocks bought in the i-th purchase, amounting to V_i euros. He is now reviewing the performance of his stock portfolio and notices that some periods have been particularly profitable. We consider an uninterrupted sequence of stock purchases profitable when the purchases have been only made with money coming from the streaming service and the amount bought each time never decreased...