P3558 [POI 2013] BAJ-Bytecomputer
题目描述
A sequence of  integers  from the set  is given.
The bytecomputer is a device that allows the following operation on the sequence:
incrementing  by  for any .
There is no limit on the range of integers the bytecomputer can store, i.e., each  can (in principle) have arbitrarily small or large value.
Program the bytecomputer so that it transforms the input sequence into a non-decreasing sequence (i.e., such that ) with the minimum number of operations.
输入格式
无
输出格式
无