题解列表

筛选

反复使用sort函数

摘要:解题思路:反复使用sort函数注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int pa[101];int main(){   int n;……

3039: 分成互质组(递归)

解题思路:建立数组v记录组别,遍历每一个数字,分别和当前组别每一个数字判断是否有大于1的公约数,如果没有,在v数组中标记该数字的组别,如果有有,递归下一个组别,如果当前组别比最大组别大,标记为新组,返回。注意事项:参考代码:#includeusingnamespacestd;int

简单的贪心题

摘要:解题思路:     网站指定是贪心算法,那就是最简单的类似背包题目。先从最大面值的钱开始尝试注意事项:  参考代码:#include<bits/stdc++.h>using namespace std……

黑白棋子的移动(C++)

摘要:解题思路:注意事项:参考代码:#include <iostream>#include <iomanip>using namespace std;int n, rt, step = 0;char a[1……

[编程入门]完数的判断

摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){    int N,i,j,sum=0,flag=0;    cin >……

[编程入门]水仙花数判断

摘要:解题思路:注意事项:参考代码:#include<iostream>#include<cmath>using namespace std;int main(){    int i,a,b,c;    f……

[编程入门]求和训练

摘要:解题思路:注意事项:参考代码:#include<iostream>#include<cmath>#include<iomanip>using namespace std;int main(){    ……

编写题解阶乘求和

摘要:解题思路:注意事项:当输入19时出现负的结果说明int的范围不够,用longlong类型保存结果参考代码:#include<iostream>using namespace std;int main(……