#P4127. [AHOI2009] 同类分布

    ID: 3059 远端评测题 3000ms 125MiB 尝试: 0 已通过: 0 难度: 7 上传者: 标签>动态规划,dp搜索递推2009各省省选安徽枚举,暴力数位 dp

[AHOI2009] 同类分布

Description

Given two numbers a,ba, b, find the count of integers in [a,b][a, b] whose sum of digits divides the number itself.

Input Format

One line, two integers aa and bb.

Output Format

A single integer representing the answer.

10 19
3

Hint

For all testdata, 1ab10181 \le a \le b \le 10^{18}.

Translated by ChatGPT 5