阶乘求和(自定义函数法) 摘要:解题思路:因为最后结果是由很多个阶乘相加,所以我们可以自定义一个阶乘函数,然后再利用循环将多个阶乘相加首先,自定义阶乘函数#include<iostream>using namespace std;l…… 题解列表 2024年10月20日 1 点赞 0 评论 1142 浏览 评分:9.9
红与黑C++代码(程序不用回溯) 摘要:注意事项: 这个程序不用回溯,回溯过于浪费时间。参考代码:#include<bits/stdc++.h>using namespace std;int w,h,maxx;bool boo…… 题解列表 2024年10月20日 0 点赞 0 评论 572 浏览 评分:9.9
[编程入门]自定义函数处理最大公约数与最小公倍数 解题思路:一个主函数外加一个被调用函数,被调用函数中运用辗转相除法求最大公约数,主函数利用数学公式最小公倍数=a*b/最大公约数,求出最小公倍数。注意事项:被调用函数中使用辗转相除法时用while循环,return(b)要写在while循环外。 题解列表 2024年10月20日 0 点赞 1 评论 1101 浏览 评分:10.0
只能说无意义的埋坑 摘要:参考代码:#include<bits/stdc++.h> using namespace std; int main() { string s; // cin>>s;有一个点…… 题解列表 2024年10月20日 0 点赞 1 评论 739 浏览 评分:0.0
亲和数c++语言 摘要:#include<iostream> using namespace std; int Yue(int n) { int sum = 0; for (int i = 1; i < n;…… 题解列表 2024年10月19日 0 点赞 0 评论 502 浏览 评分:0.0
信息学奥赛一本通T1347-格子游戏 并查集 #includeusingnamespacestd;constintN=40010;intp[N];intn,m;intfind(intx){if(p[x]!=x){p[x]=find(p[x]);}returnp[x];}intget(intx, 题解列表 2024年10月19日 1 点赞 0 评论 540 浏览 评分:9.9
信息学奥赛一本通T1346-亲戚(relation) 并查集 此题有毒 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;const int MAXN = 20010;int father[MAXN];in…… 题解列表 2024年10月19日 0 点赞 0 评论 780 浏览 评分:9.9
[蓝桥杯2022年第十三届决赛真题-最大数字] 贪心+dfs #咋还给我爆longlong了啊这题```cpp#include#defineULLunsignedlonglong#defineLLlonglong#defineendl'\n'#definedebug(a)cout>B;len=num.size();for(inti=0;i 题解列表 2024年10月19日 0 点赞 0 评论 862 浏览 评分:9.9
寻梦之C++解题 摘要:#include<iostream> #include<string> using namespace std; int main() { int n; string s1, s2;…… 题解列表 2024年10月19日 0 点赞 0 评论 417 浏览 评分:10.0
数字的处理与判断 摘要:解题思路:转化为字符串问题注意事项:字符串反转,双指针参考代码:#include<bits/stdc++.h>using namespace std;string ver(string s){//反转…… 题解列表 2024年10月19日 0 点赞 0 评论 595 浏览 评分:0.0