CodeForces - 55D(数位dp,离散化)
题目来源:http://codeforces.com/problemset/problem/55/D Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if and only if it is divisible by each of its nonzero digits. We will not argue with this and just count the quantity of beautiful numbers in given ranges. Input The first line of the input contains the number of cases t ( 1 ≤ t ≤ 10). Each of the next t lines contains two natural numbers l i and r i ( 1 ≤ l i ≤ r i ≤ 9 ·10 18 ). Please, do not use %lld specificator to read or write 64-bit integers in C++. It is preffered