【例50.3】 平衡数
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Description
A balanced number is a positive integer where each digit appears exactly times in . For example, is a balanced number because:
For the hundreds digit , the digit appears exactly time in , satisfying the condition;
For the tens digit , the digit appears exactly times in , satisfying the condition;
For the ones digit , the digit appears exactly times in , satisfying the condition;
Since every digit in satisfies the condition, is a balanced number.
Given two positive integers and (), please help calculate the sum of all balanced numbers between and .
Input Format
One line containing two positive integers and (), separated by a space.
Output Format
One line containing a single integer, representing the sum of all balanced numbers between and .
Sample
1 2523
20251129 B班作业(8)
- Status
- Done
- Problem
- 6
- Open Since
- 2025-11-29 0:00
- Deadline
- 2025-12-7 23:59
- Extension
- 24 hour(s)