Running Maximum

Easy · rating 1000 · Arrays

The first line contains n. The second line has n integers. Print the running maximum: for each position, the largest value seen so far. Output them space-separated.

Constraints: 1 ≤ n ≤ 105

Related problems

Open Running Maximum in Code Arena →