原题直通车: HDU 4722 Good Numbers 题意: 求区间[a,b]中各位数和mod 10==0的个数. 代码: #include<iostream> #include<cstdio> #include<cstring> #include<cmath> using namespace std; int f[20]; long long work(long long x){ long long ret=0, u=x; int t=0, s=0…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4722 Good Numbers Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 422 Accepted Submission(s): 146 Problem Description If we sum up every digit o…
Description If we sum up every digit of a number and the result can be exactly divided by 10, we say this number is a good number. You are required to count the number of good numbers in the range from A to B, inclusive. Input The first line has a…
Good Numbers Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3467 Accepted Submission(s): 1099 Problem Description If we sum up every digit of a number and the result can be exactly divided b…
If we sum up every digit of a number and the result can be exactly divided by 10, we say this number is a good number. You are required to count the number of good numbers in the range from A to B, inclusive. InputThe first line has a number T (T <=…
#include<iostream> #include<cstring> #include<cstdio> #include<vector> #include<queue> using namespace std; #define ll long long #define maxn 100050 int ok(ll n){ *;i<=n;i++){ ll sum = ,tmp = i; while(tmp){ sum += tmp%; tm…