图的遍历-DFS ```cpp#includeusingnamespacestd;#definelllonglongintn;//节点数constintN=55;//最大节点数intmp[N][N]={};//邻接表boolvis[N]={};//标记intstep=0;//遍历步数voiddfs(intx){//x表 题解列表 2023年02月10日 0 点赞 0 评论 724 浏览 评分:0.0
计算(a+b)*c的值 (c++) 摘要:解题思路:先设置变量a,b,c,再输入变量,最后输出(a+b)*c的值注意事项:a+b要带括号参考代码:#include<iostream>//导入头文件using namespace std;int…… 题解列表 2023年02月10日 0 点赞 0 评论 652 浏览 评分:9.9
计负均正1061题解 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int num[20]; double count=0.0…… 题解列表 2023年02月10日 0 点赞 0 评论 439 浏览 评分:0.0
计算(a+b)/c的值 (c++) 摘要:解题思路:先定义整数a,b,c,用cout输出(a+b)/c的值,就可以提交代码了。参考代码:#include<iostream>//导入头文件using namespace std;int main…… 题解列表 2023年02月10日 0 点赞 0 评论 1038 浏览 评分:9.9
编写题解 1117: K-进制数 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;typedef long long LL;LL n,k,res;LL fac(in…… 题解列表 2023年02月10日 0 点赞 0 评论 483 浏览 评分:9.9
1334: [NOIP2004]合唱队形 摘要:解题思路:这道题其实就是从前和从后来求两个不下降序列。 b[i]:从第i个数开始的最长不下降序列 c[i]:从第i个数结束的最长不下降序列 类似与登山。注意事项:注意>号和<号!参考代码:#in…… 题解列表 2023年02月10日 0 点赞 0 评论 756 浏览 评分:9.9
2128: 信息学奥赛一本通T1264-合唱队形 摘要:解题思路:运用动态规划解此题!!!注意事项:参考代码:#include<bits/stdc++.h> using namespace std; int a[1005],b[1005],c[1005…… 题解列表 2023年02月10日 0 点赞 0 评论 594 浏览 评分:6.0
2808: 买房子 (中关村怎么可能有这么便宜的房子) 摘要:解题思路:注意事项:参考代码:#include <iostream> // #include <sstream> #include <cstdio> // #include <algorithm…… 题解列表 2023年02月10日 0 点赞 0 评论 625 浏览 评分:0.0
2805: 乘方计算 快速幂方法 摘要:解题思路: 快速幂注意事项:参考代码:#include <iostream> // #include <sstream> #include <cstdio> // #include <algor…… 题解列表 2023年02月09日 0 点赞 0 评论 744 浏览 评分:0.0
因数平方和(数论分块+数学式子推导) ~~~#includeusingnamespacestd;constintmod=1e9+7;typedeflonglongll;intn;llqmin(lla,llb,intm){lls=1;while(b){if(b&1)s=a%m*s%m;a=a%m*a%m;b>>=1;}returns;}ll 题解列表 2023年02月09日 0 点赞 0 评论 1052 浏览 评分:5.0