cswork / OA打开练习工作台

MetaOA #10

Three-Digit Numbers With All Distinct Digits

估计简单可在线判题

考点(AI 标注)位运算

Given a closed range [left,right], count the three-digit integers in it whose hundreds, tens, and ones digits are pairwise different. The original site's answer of 5 for 476..979 is wrong, so this site uses an example recomputed from the definition.

输入格式

One line with left right (100≤left≤right≤999).

输出格式

Output the answer as described; separate multiple results with spaces in order, and output an empty line for an empty array.

样例 1

输入:

476 979

输出:

371

样例 2

输入:

100 100

输出:

0

样例 3

输入:

102 102

输出:

1

样例说明

Example 1: checking each three-digit number from 476 to 979, there are 371 integers whose digits are pairwise different; for example, 476 is valid and 477 is not.