luogu#P4127. [AHOI2009] 同类分布

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

[AHOI2009] 同类分布

Problem 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