LOJ10163 Amount of Degrees】的更多相关文章

发现自己以前对数位DP其实一窍不通... 这题可以做一个很简单的转换:一个数如果在$b$进制下是一个01串,且1的个数恰好有k个,那么这个数就是合法的(刚开始没判断必定是01串,只判断了1的个数竟然有60pts,数据可真的水~) 这个结论显然成立,也不需要什么证明啦qaq~ 然后数位DP就好了 转化为b进制后要么插1要么插0,$dp[x][cnt]$表示当前处理到第i为,已经有cnt个1的情况下 转移方程: $$dp[x][cnt]=\sum dp[x-1][cnt+1](当前位为1)$$ $$…
题目描述 求给定区间 [X,Y] 中满足下列条件的整数个数:这个数恰好等于 KK 个互不相等的 BB 的整数次幂之和.例如,设 X=15,Y=20,K=2,B=2,则有且仅有下列三个数满足题意 输入格式 第一行包含两个整数 X 和 Y,接下来两行包含整数 K 和 B. 输出格式 只包含一个整数,表示满足条件的数的个数. 样例 样例输入 15 20 2 2 样例输出 3 数据范围与提示 对于全部数据,1≤X≤Y≤2^31−1,1≤K≤20,2≤B≤10. _____________________…
[TimusOJ1057]Amount of Degrees 试题描述 Create a code to determine the amount of integers, lying in the set [X;Y] and being a sum of exactly K different integer degrees of B. Example. Let X=15, Y=20, K=2, B=2. By this example 3 numbers are the sum of exa…
1585: [例 1]Amount of Degrees 时间限制: 1000 ms         内存限制: 524288 KB 题目描述 原题来自:NEERC 2000 Central Subregional,题面详见 Ural 1057. 求给定区间 [X,Y] 中满足下列条件的整数个数:这个数恰好等于 K 个互不相等的 B 的整数次幂之和.例如,设 X=15,Y=20,K=2,B=2,则有且仅有下列三个数满足题意: 17=2^4+2^0 18=2^4+2^1 20=2^4+2^2 输入…
1057. Amount of Degrees Time limit: 1.0 second Memory limit: 64 MB Create a code to determine the amount of integers, lying in the set [X;Y] and being a sum of exactlyK different integer degrees of B. Example. Let X=15, Y=20, K=2, B=2. By this exampl…
1057. Amount of Degrees Time limit: 1.0 second Memory limit: 64 MB Create a code to determine the amount of integers, lying in the set [X;Y] and being a sum of exactlyK different integer degrees of B. Example. Let X=15, Y=20, K=2, B=2. By this exampl…
传送门 Amount of Degrees Time limit: 1.0 secondMemory limit: 64 MB Description Create a code to determine the amount of integers, lying in the set [X;Y] and being a sum of exactly K different integer degrees of B. Example. Let X=15, Y=20, K=2, B=2. By t…
废话不多说,直接上题: 1585: [例 1]Amount of Degrees 时间限制: 1000 ms         内存限制: 524288 KB提交数: 130     通过数: 68 [题目描述] 原题来自:NEERC 2000 Central Subregional,题面详见 Ural 1057. 求给定区间 [X,Y] 中满足下列条件的整数个数:这个数恰好等于 K 个互不相等的 B 的整数次幂之和.例如,设 X=15,Y=20,K=2,B=2,则有且仅有下列三个数满足题意: 1…
Discription Create a code to determine the amount of integers, lying in the set [X; Y] and being a sum of exactly K different integer degrees of B. Example. Let X=15, Y=20, K=2, B=2. By this example 3 numbers are the sum of exactly two integer degree…
Create a code to determine the amount of integers, lying in the set [X;Y] and being a sum of exactly K different integer degrees of B. Example. Let X=15, Y=20, K=2, B=2. By this example 3 numbers are the sum of exactly two integer degrees of number 2…