摘要: 题目 分析 高斯消元解异或方程组,和解普通方程组差不多。 范围有点大,要套一个bitset。 代码 #include <bits/stdc++.h> using namespace std; const int maxn = 1050; bitset<maxn> a[maxn*2]; int n, 阅读全文
posted @ 2018-10-03 23:33 noble_(noblex) 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 题目 分析 高斯消元就是个大暴力。。。。 代码 #include <bits/stdc++.h> using namespace std; const int maxn = 105; const double eps = 1e-7; int n; double a[maxn][maxn], b[ma 阅读全文
posted @ 2018-10-03 23:31 noble_(noblex) 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 题目 分析 题意就是求∑gcd(i, N) 1<=i <=N.。 显然$ gcd(i,n) = x $时,必然$x|n$。 所以我们枚举一下n的约数,对于每个约数x,显然$ gcd(i/x,n/x)=1$ 所以我们计算一下n/x的欧拉函数就ok了。 联赛前刷水题qwq 代码 // #include 阅读全文
posted @ 2018-10-03 23:09 noble_(noblex) 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 题目 分析 $ O(nlogn) $预处理出阶乘和阶乘的逆元,然后求组合数就成了$O(1)$了。 最后再套上错排公式:$ \huge d[i]=(i-1) \times (d[i-1] + d[i-2])$其中$ d[i] $表示把i个数错排的方式数量,其中$d[1]=0,d[2]=1$ 代码 #i 阅读全文
posted @ 2018-10-03 23:03 noble_(noblex) 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 题目 分析 莫比乌斯反演。 还不是很熟练qwq 代码 //bzoj1101 //给出a,b,d,询问有多少对二元组(x,y)满足gcd(x,y)=d.x<=a,y<=b #include <bits/stdc++.h> using namespace std; const int maxn = 50 阅读全文
posted @ 2018-10-03 22:57 noble_(noblex) 阅读(158) 评论(0) 推荐(0) 编辑
/* */