[编程入门]有规律的数列求和-题解(C语言-斐波那契数列) 我是用斐波那契数列递归来计算,这个方法比分子分母调换顺序要复杂,大家就当扩展思维吧!我的思路:设第一项分子为a,分母为b,那么设第二项分子为a+b,分母为a,第三项分子为2a+b,分母为a+b,第四项分子为3a+2b,分母为2a+b......依此类推, 题解列表 2020年03月13日 0 点赞 0 评论 2144 浏览 评分:9.9
蓝桥杯算法提高VIP-种树-题解(C++代码) 就说快不快?````cpp#includeintm,n,a[40],vis[40],ans=-30001;//DFS,哈哈开整voidDFS(intdeep,intsum,intcount){if(count>m)return;if(count==m)ans=ans 题解列表 2020年03月13日 0 点赞 0 评论 1638 浏览 评分:9.9
Manchester-【字符串问题】 ###解题思路:1.法一:输入一个字符串,求其长度,然后从最后一个字符一次向前输出1.法二:把字符串存入栈,然后把栈中元素pop出来1.以上两种方法本质上一样,这里采用第二种方法,回顾栈知识```c#include#include//定义一个字符栈typedefstructStack_{charA[2 题解列表 2020年03月13日 0 点赞 0 评论 2023 浏览 评分:9.9
蓝桥杯算法提高VIP-矩阵乘法 (C++代码) ######与合并石子那题有点类似定义dp[i][j]:第i个矩阵依次乘到第j个矩阵的最少的运算次数;定义A[i][j]:第i个矩阵依次乘到第j个矩阵所得的矩阵那么A[i][j]=A[i][k]*A[k+1][j](k=itoj-1)这样将在k从i遍历到j-1的过程中,更新dp[i][j]的值。 题解列表 2020年03月13日 0 点赞 0 评论 1455 浏览 评分:9.9
数据结构-一元多项式加法-题解(C++代码) ```cpp#include#include#include#include#include#include#include#include#definen30usingnamespacestd;typedefstructNode{intcoe;intexp;}Node, 题解列表 2020年03月13日 0 点赞 0 评论 1647 浏览 评分:9.9
数据结构-无向图的连通分量和生成树-题解(C++代码) ```cpp#includeusingnamespacestd;constintn=52;typedefintadjMatrix[n][n];structGraph{intvexnum;adjMatrixarcs;};structNode{intdata;structNode*lchild=NULL; 题解列表 2020年03月13日 0 点赞 0 评论 1497 浏览 评分:9.9
C语言训练-最大数问题-题解(C++代码) ```cpp#includeusingnamespacestd;typedefstructNode{intdata;structNode*next;};voidcreate_list(Node*&p){Node*l=p,*s;l->next=NULL;//头结点//碰到-1退出intn;cin>>n; 题解列表 2020年03月13日 0 点赞 1 评论 1246 浏览 评分:9.9
蓝桥杯算法训练VIP-一元三次方程求解-题解(Python代码) ###python二分查找```pythona,b,c,d=map(float,input().split())deff(x):returna*x**3+b*x**2+c*x+dforiinrange(-100,100):l,r=i,i+1flag=1whiler-l>10e-5:mid=(l+r)/ 题解列表 2020年03月13日 0 点赞 1 评论 1911 浏览 评分:9.9
数据结构-线索二叉树-题解(C++代码) ```cpp#includeusingnamespacestd;structA{chardata;structA*lchild;structA*rchild;intltag=0,rtag=0;};typedefA*PA;voidInThreading(PA&p, 题解列表 2020年03月13日 0 点赞 0 评论 1180 浏览 评分:9.9
数据结构-自底向上的赫夫曼编码-题解(C++代码) ```cpp#include#include#include#include#includeusingnamespacestd;structNode{intweight=0;intparent=0;intlchild=0;intrchild=0;};typedefNode*PN;voidselect( 题解列表 2020年03月13日 0 点赞 0 评论 2238 浏览 评分:9.9