JZPEXT - Beautiful numbers EXTREME
We call one integer beautiful, if and only if it is divisible by each of its non-zero digits. Given an interval [l, r], calculate how many beautiful numbers n satisfy l<=n<=r.
First line, the number of test cases, t.
Then t lines follow, each line two numbers l, r, representing the query interval [l, r].
t lines. The t-th line is the answer to the t-th query.
Input: 1 1 100
can someone give me an optimized code my code is running but the time complexity for large input is very high
What is the damn purpose of this problem? And why the hell source limit? I wasted 2 hours optimizing my solution only to find out it's too long. Got AC afterwards but this problem sucks hard.
Not much fun in solving this...Last edit: 2013-12-12 11:06:35
who can tell me the real answer....I can't do it .. TLE always..
Resource: Codeforces Beta Round #55.