X mod f(x)
Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1403 Accepted Submission(s): 599
int f ( int x ) {
if ( x == 0 ) return 0;
return f ( x / 10 ) + x % 10;
}
Now, you want to know, in a given interval [A, B] (1 <= A <= B <= 109), how many integer x that mod f(x) equal to 0.
Each test case has two integers A, B.
1 10
11 20
Case 2: 3
#include <iostream>
#include <cstdio> #include <cstring> using namespace std; int bit[10],dp[10][82][82][82]; int dfs(int pos,int sum,int mod,int res,bool limit) int calu(int x) int main() |
* This source code was highlighted by YcdoiT. ( style: Codeblocks )