题解列表
计算素数和(用C++)
摘要:参考代码:#include<iostream>
using namespace std;
bool isprime(int x)
{
int count = 0;
for (int i ……
2^k进制数:组合数
摘要:解题思路:组合数注意事项:参考代码:#include<iostream>
#include<cmath>
using namespace std;
long long c(int n, int ……
简明易懂的c语言解法,其他语言也可以借鉴
摘要:解题思路:如果b是a的因数和,我们再去检验b的因数和是不是a,所以对于每个a,先让b=a的因数和,就可以大大减少计算注意事项:这道题要通过思考a、b关系简化运算,不然容易超时参考代码:#include……
最后一个点卡数组小于k和多组数据
摘要:#include<bits/stdc++.h>
using namespace std;
int main()
{
int t,k;
while(cin>>t>>k)
……
不用考虑斜率不存在和分母为0的方法——余弦定理
摘要:解题思路:参考代码:#include<bits/stdc++.h>
using namespace std;
#define PI 3.14159265358979323846
void sol……
编写题解 1027: [编程入门]自定义函数处理最大公约数与最小公倍数
摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int y(int a,int b) { for(int i=min(a,b);i>……
dfs+判断数组解决排列
摘要:解题思路:注意事项:坑:1.题目空了一格输出,输出一个就换行2.字典序输出参考代码:#include<bits/stdc++.h>const int N=10;//题目默认字典序了strcmpint ……
最简单的组合数问题(递推法)
摘要:#include<bits/stdc++.h>
using namespace std;
const int N=2010;
int c[N][N];
void init()
{
for……