题解列表

筛选

辗转相除法

摘要:解题思路:使用辗转相除法求最大公约数,编写一个函数计算,然后根据定义求最小公倍数,再编写一个函数计算注意事项:函数名不能与变量名相同参考代码:#include<bits/stdc++.h>……

分解质因数与容斥原理

摘要:思路:设n个数,它们的最大公因子为G,最小公倍数为L,问有多少种不同的方法还原这个数列。质因数分解:每个数ai都可以分解为质因数的乘积,即:ai=p1ei1⋅p2ei2⋅…⋅pkeik,其中p1,p2……

for轮询输入输出

摘要:解题思路:先使用for循环输入数据,再反向输出注意事项:注意数组元素下标和循环控制条件参考代码:#include<bits/stdc++.h>using namespace std;int……

素数回文(欧拉筛)

摘要:解题思路:欧拉筛注意事项:参考代码:#include<bits/stdc++.h>usingnamespacestd;constint ……

简单编码(字典)

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>usingnamespacestd;intmain(){ ……

简单的事情(模拟)

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>usingnamespacestd;longlongfa……

筛排处理(set)

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>usingnamespacestd;constintN&……

第几天(模拟)

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>usingnamespacestd;intmain(){ ……