感觉不错的方法 摘要:解题思路:注意事项:参考代码:#include <iostream> // 包含输入输出流库using namespace std; // 使用标准命名空间int main() { // 主函数入口 …… 题解列表 2024年02月26日 0 点赞 0 评论 662 浏览 评分:0.0
题解 1088: A+B for Input-Output Practice (IV) 摘要:`while(cin>>n)`加上`for(int i=1;i>n&&n!=0){ int sum=0,x; for(int i=1;i>x; sum+=x; } co…… 题解列表 2024年02月25日 0 点赞 0 评论 605 浏览 评分:9.9
题解 1086: A+B for Input-Output Practice (II) 摘要:`for`枚举1到n即可 ```cpp #include using namespace std; int main(){ long long a,b; int n; cin>>n…… 题解列表 2024年02月25日 1 点赞 0 评论 753 浏览 评分:9.9
题解 1085: A+B for Input-Output Practice (I) 摘要:`while(cin>>)`即可。 ````cpp #include using namespace std; int main(){ long long a,b; while(cin…… 题解列表 2024年02月25日 0 点赞 0 评论 713 浏览 评分:9.9
编写题解 3016: 第几项 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ int i=0,sum=0,m; cin>>m…… 题解列表 2024年02月25日 0 点赞 0 评论 460 浏览 评分:0.0
用递归方法求阶乘 解题思路:写factorial()函数利用递归求阶乘易知,x!=x*(x-1)!=x*(x-1)*(x-2)!=...=x*(x-1)*(x-2)*...*1因此,可以利用递归求得x!,即在factorial函数内调用factorial函数核心代码longlongfactorial(intx){if( 题解列表 2024年02月24日 0 点赞 0 评论 667 浏览 评分:9.9
蓝桥杯2022年第十三届决赛真题-最大数字-暴力解 摘要:解题思路:最大数字,尽量从第一位开始每一位都接近 9;如果果该位是9就不用管 1)该位 + 可增加的次数 a 是否会超过 9, 超过就可以让该位达到9,增加次数-让该位到9的次数2)该位 < 减少次数…… 题解列表 2024年02月24日 1 点赞 6 评论 1494 浏览 评分:9.9
蓝桥杯2023年第十四届省赛真题-飞机降落(暴力枚举) 基于全排列函数next_permutation 摘要:解题思路:注意事项:有题目数据范围飞机数量 n<=10,可知本问题可对所有飞机的下落顺序进行全排(最大循环次数10!*10约为3e7,可过所有样例),得到得所以方案中有一种满足即为YES。即当得到一种…… 题解列表 2024年02月23日 0 点赞 2 评论 1851 浏览 评分:9.3
冶炼金属--超快解法 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<cstring>#include<algorithm>using namespace std;const int i…… 题解列表 2024年02月23日 0 点赞 0 评论 726 浏览 评分:9.9
家人们,这个题解超简单! 摘要:解题思路:将金银铜分别输入三次即可,并先输入比了多少天即可。注意事项:不能把a,b,c的输入写在外面。参考代码:#include <bits/stdc++.h>using namespace std;…… 题解列表 2024年02月23日 0 点赞 1 评论 445 浏览 评分:9.9