最简单代码(python) 摘要:解题思路:就是求几个1+2+....的和注意事项:注意min函数那里,代表着有几个1+2+...参考代码:k,w = map(int, input().split())if w%k == 0: …… 题解列表 2021年03月18日 0 点赞 0 评论 520 浏览 评分:9.9
2^k进制数 (递归解决) 摘要:```cpp #include #include using namespace std; int pr,max2,tot=0; void dp(int bit,int n){ if(b…… 题解列表 2019年09月05日 0 点赞 3 评论 1284 浏览 评分:9.9
动态规划—C语言 摘要:解题思路:注意事项:参考代码:#include <stdio.h> #include <string.h> #include <malloc.h> #include <math.h> #def…… 题解列表 2022年09月15日 0 点赞 0 评论 502 浏览 评分:9.9
2^k进制数-题解(Python代码) 摘要:主要是排列组合问题。 只需考虑到(在首位没有限制的情况下),这种单向递增的n位m进制数个数,就是在1-m-1这(m-1)个数字中挑出n个,故直接利用二项式系数即可。 在首位有限制时方法也是一样的。…… 题解列表 2019年08月27日 0 点赞 2 评论 1262 浏览 评分:9.9
注意w大于2^k进制数所能达到的最大的位数 摘要: #include #include using namespace std; int Level(int k, int w){ //计算用2^k进制表示的数,最多的…… 题解列表 2022年01月19日 0 点赞 0 评论 600 浏览 评分:9.9
编写题解 1110: 2^k进制数 摘要:```cpp #include #include using namespace std; int pr,max2,tot=0; void dp(int bit,int n){ i…… 题解列表 2024年11月10日 0 点赞 0 评论 421 浏览 评分:9.9
2^k进制数,理解 摘要:解题思路:相当于是一个包含排列组合的动态规划,还包含高精度,要注意的是这个题的测试系统样例相对较小,所以int类型和一些错误写法也可以过去注意事项:这是拿排列组合做的,下来还会写动态二位数组的参考代码…… 题解列表 2021年11月21日 0 点赞 0 评论 834 浏览 评分:9.9
2^k进制数 (Java代码) 摘要:解题思路:注意事项:参考代码:public static void main(String[] args) { Scanner scanner = new Scanner(System.in…… 题解列表 2019年03月09日 0 点赞 0 评论 1727 浏览 评分:9.9
2^k进制数 (Java代码) 摘要:解题思路:我的方法就是上来就把几种可能罗列出来,然后找规律,这种方法可能巨慢(反正我想了半天)注意事项:以r转换为二进制后的最少位数开始,可能的次数为(2^k-2)+(2^k-3)+...+1,其中相…… 题解列表 2018年12月04日 1 点赞 1 评论 1696 浏览 评分:9.9
2^k进制数代码详细说明 摘要:解题思路:找到规律即可注意事项:主要要注意分段后可能剩下的不能组成k位的数值取值情况参考代码:import mathk,w=map(int,input().split())a=math.ceil(w/…… 题解列表 2021年11月03日 0 点赞 0 评论 539 浏览 评分:9.9