eolymp
bolt
Try our new interface for solving problems
Məsələlər

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.
Zaman məhdudiyyəti 2 saniyə
Yaddaşı istafadə məhdudiyyəti 256 MiB
Giriş verilənləri #1
10 99
Çıxış verilənləri #1
72
Müəllif Пётр Митричев
Mənbə Зимняя школа, Харьков 2011, День 8