from typing import List


def get_cum_elevation_gain(elevations: List[float]) -> float:
    """
    Function that given the ordered sequence of elevation measurements during an
    activity, returns the total elevation gain.
    Args:
        elevations: List of elevation measurements.
    Returns:
        Cumulative elevation gain.
    """

    gain = 0

    # 0 gain if elevations empty
    if not elevations:
        return 0

    last_elevation = elevations[0]
    del elevations[0]

    for elevation in elevations:

        # signed increase within the last change
        delta = elevation - last_elevation

        # only add uphill change
        gain += max(delta, 0)

        # update last_elevation to current elevation
        last_elevation = elevation

    return gain