[题目]C. Sonya and Problem Wihtout a Legend [题意]给定n个数字,每次操作可以对一个数字±1,求最少操作次数使数列递增.n<=10^5. [算法]动态规划+前缀和优化 [题解]★令b[i]=a[i]-i,则a[i]递增等价于b[i]不递减. 这样做之后,显然数字加减只能到b[i]中出现的数字,而不会出现其它数字. 令f[i][j]表示前i个数,第i个数字大小为c[j](第j大的数字)的最少操作次数. f[i][j]=abs(b[i]-c[j])+min{f…