CF 1530H - Turing's Award

We are given a permutation of numbers from 1 to n. A token starts at position 0 on an infinite integer line. Over time, each value of the permutation is written on

CF 1530H - Turing's Award

Rating: 3400
Tags: data structures, dp
Solve time: 1m 1s
Verified: no

Solution

Problem Understanding

We are given a permutation of numbers from 1 to n. A token starts at position 0 on an infinite integer line. Over time, each value of the permutation is written on