beautiful number Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 801 Accepted Submission(s): 518 Problem Description Let A=∑ni=1ai∗10n−i(1≤ai≤9)(n is the number of A's digits). We call A as “…
题意: 一个如果称作是漂亮数,当且仅当满足: 每一位上的数字是[1,9],从高到时低数字大小降序,且有di%dj=0(i<j) 例:931 给一个区间[L,R],问这个区间里有多少个漂亮数. 1≤L≤R≤109 思路: 漂亮数一看就很少.可以直接构造. 哎,,,用了DP+构造,写了好久...其实很简单的一个DFS构造就行了. 过些天补上代码.先贴冗长代码~ 代码: int T,L,R; int wei; int ans1,ans2,ans; int d[15], w[15]; int dp[15…
Codeforces 55D Beautiful Number a positive integer number is beautiful if and only if it is divisible by each of its nonzero digits. Input The first line of the input contains the number of cases t (1 ≤ t ≤ 10). Each of the next t lines contains two…
Cube number on a tree Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 1628 Accepted Submission(s): 382 Problem Description The country Tom living in is famous for traveling. Every year, man…