随笔分类 -  数学

摘要:给定两个0/1序列 要求经过若干操作从一个序列变成另一个序列 其中给定若干组关系 操作一个的时候另一个也会变化 每个位置只能被主动操作一次 关系不具有传递性 求方案数 #include <iostream> #include <cstdio> #include <cstring> #include 阅读全文
posted @ 2022-02-10 11:30 __iostream 阅读(33) 评论(0) 推荐(0) 编辑
摘要:高斯消元 #include <iostream> #include <cstdio> #include <cstring> #include <cmath> using namespace std; const int eps=1e-8; const int N=15; double a[N][N] 阅读全文
posted @ 2022-02-09 21:25 __iostream 阅读(22) 评论(0) 推荐(0) 编辑
摘要:质因数分解n! for(int i=2;i<=n;i++) { if(vis[i]) continue; s[++tot]=i; for(int j=i;j<=n/i;j++) vis[i*j]=1; } for(int i=1;i<=tot;i++) { int p=s[i],sum=0,tmp= 阅读全文
posted @ 2022-02-08 10:50 __iostream 阅读(44) 评论(0) 推荐(0) 编辑
摘要:1. 欧拉函数 p 为n的质因子 φ(n)=n×Π(11p) 1~n中与n互质的数的和:n2×φ(n) 如果a,b互质,那么$\varphi(ab)=\varphi(a)\times\va 阅读全文
posted @ 2022-02-08 10:49 __iostream 阅读(45) 评论(0) 推荐(0) 编辑
摘要:L~R中质数距离最小最大值(R-L<=1e6) 思路过程: 注意到区间长度很小 我们考虑采用枚举区间长度的办法 O(LR) 转化思路 用n内 所有的倍数筛掉区间内的数 复杂度不便 注意到这样会有重复 那么我们用n内所有质数筛一遍就可以 线性筛包 阅读全文
posted @ 2022-02-08 10:49 __iostream 阅读(29) 评论(0) 推荐(0) 编辑
摘要:求下式的最大值: inai×xiinbi×xi 也就是 对任意的x inai×xiinbi×xians 阅读全文
posted @ 2022-01-13 21:39 __iostream 阅读(58) 评论(0) 推荐(0) 编辑
摘要:斐波那契数列 #include <iostream> #include <cstdio> #include <cstring> #define ll long long using namespace std; const int mod=10000; int read() { int x=0,f= 阅读全文
posted @ 2022-01-09 16:13 __iostream 阅读(25) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示