Increasing Numbers

AtCoder
IDagc011_e
Time2000ms
Memory256MB
Difficulty
We will call a non-negative integer _increasing_ if, for any two adjacent digits in its decimal representation, the digit to the right is greater than or equal to the digit to the left. For example, $1558$, $11$, $3$ and $0$ are all increasing; $10$ and $20170312$ are not. Snuke has an integer $N$. Find the minimum number of increasing integers that can represent $N$ as their sum. ## Constraints * $1 \leq N \leq 10^{500000}$ ## Input The input is given from Standard Input in the following format: $N$ [samples]
Samples
Input #1
80
Output #1
2

One possible representation is $80 = 77 + 3$.
Input #2
123456789
Output #2
1

$123456789$ in itself is increasing, and thus it can be represented as the sum of one increasing integer.
Input #3
20170312
Output #3
4
Input #4
7204647845201772120166980358816078279571541735614841625060678056933503
Output #4
31
API Response (JSON)
{
  "problem": {
    "name": "Increasing Numbers",
    "description": {
      "content": "We will call a non-negative integer _increasing_ if, for any two adjacent digits in its decimal representation, the digit to the right is greater than or equal to the digit to the left. For example, $",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "agc011_e"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "We will call a non-negative integer _increasing_ if, for any two adjacent digits in its decimal representation, the digit to the right is greater than or equal to the digit to the left. For example, $...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments