eolymp
bolt
Спробуйте наш новий інтерфейс для відправки розв'язків
Задачі

Number Permulations

Number Permulations

Two distinct positive integer numbers with decimal notations of the same length are called \textit{similar}, if their decimal notations can be obtained from each other by permuting the digits. How many numbers from the segment \[\textit{\textbf{l}}, \textbf{r}\] have exactly one similar number in that segment? \InputFile The input file contains two integer numbers \textit{\textbf{l}} and \textbf{r} (\textbf{1} ≤ \textit{\textbf{l}} ≤ \textbf{r} ≤ \textbf{10^15}). \OutputFile Output one integer number --- the sought amount.
Ліміт часу 2 секунди
Ліміт використання пам'яті 256 MiB
Вхідні дані #1
10 99
Вихідні дані #1
72
Автор Петро Мітрічев
Джерело Зимова Школа, Харків 2011, День 8