dp实现_十二届省赛真题-左孩子右兄弟 摘要:dpi]代表以i为根节点的最高高度;c[i]:为i的孩子数;f[i]:为i的父亲注意事项:参考代码:#include<bits/stdc++.h> using namespace std; lon…… 题解列表 2022年03月03日 0 点赞 0 评论 662 浏览 评分:9.9
用筛法求之N内的素数。 (C++语言代码)优化普通方法 摘要:解题思路:直接暴力咯注意事项: 注意循环的值,j*j<=i可以减少循环次数。当j的值在不断的变大时对应的乘值x在变小,即j*x=i,相当于重复了之前的j的增长过程,(x的增大)所以 …… 题解列表 2022年03月03日 0 点赞 0 评论 392 浏览 评分:9.9
优质题解 2584: 蓝桥杯2020年第十一届省赛真题-数字三角形 C++ 摘要:解题思路:思路:相比于简单地查找动态规划查找最大路径,该题多了一个左移右移的限制,看似是多了一个条件,实则使得题目更加简单了1)当数字三角形有奇数行时,我们需要走偶数步,所以左移步数和右移步数一定相同…… 题解列表 2022年03月03日 0 点赞 0 评论 1107 浏览 评分:8.7
简单粗暴,通俗易懂 摘要:解题思路:三个数,分成个个数粗暴循环(每个三位数都尝试一遍);注意事项:是从100 开始循环,不是111参考代码:#include<bits/stdc++.h>using namespace std;…… 题解列表 2022年03月03日 0 点赞 0 评论 547 浏览 评分:9.9
宏定义之找最大数 摘要:```cpp #include using namespace std; #define da2(a,b,c) float x1,x2;x1=max(a,b);x2=max(x1,c);cout…… 题解列表 2022年03月03日 0 点赞 0 评论 217 浏览 评分:0.0
宏定义之闰年判断 摘要:```cpp #include using namespace std; #define LEAP_YEAR(y) if((y%100!=0&&y%4==0)||y%400==0){cout…… 题解列表 2022年03月03日 0 点赞 0 评论 221 浏览 评分:0.0
用宏定义练习之三角形面积 摘要:```cpp #include using namespace std; #define S(a,b,c) s=(a+b+c)/2.0; #define area(a,b,c,s) q=sqr…… 题解列表 2022年03月03日 0 点赞 0 评论 240 浏览 评分:0.0
全球变暖--新手解法 摘要:解题思路:找到每块大陆,然后判断每块大陆是否能够被淹没,如果大陆周围被大陆包围就不可能被淹没注意事项:参考代码:#include<bits/stdc++.h>using namespace std;c…… 题解列表 2022年03月03日 0 点赞 0 评论 374 浏览 评分:6.0
结构体之成绩统计2 摘要: ```cpp #include using namespace std; //结构体数组 //定义结构体 struct student { char id[50]; //学号…… 题解列表 2022年03月03日 0 点赞 0 评论 218 浏览 评分:0.0
Hifipsysta-2056-汉诺塔(C++代码) 摘要:```cpp #include using namespace std; void hanoi(int n, int A, int B, int C){ if(n==1){ …… 题解列表 2022年03月03日 0 点赞 0 评论 390 浏览 评分:0.0