• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






linjiaruiwoxihuanni

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理

2025年9月12日

1
摘要: #include <vector> #include <set> #define ls u<<1 #define rs u<<1|1 using namespace std; const int maxn=200005; int a[maxn]; struct tree{ int val; // 节 阅读全文
posted @ 2025-09-12 23:26 yFatSheep 阅读(5) 评论(0) 推荐(0)
 
大整数高精度求组合数
摘要: 将m,n,(n-m)分解质因数,然后通过他们质因数乘积来计算,因为n的阶乘除以m!(n-m)!一定是整数,这样分解就能省略除法 #include <iostream> #include <cstring> #include <algorithm> using namespace std; const 阅读全文
posted @ 2025-09-12 13:16 yFatSheep 阅读(8) 评论(0) 推荐(0)
 
卢卡斯定理求组合数
摘要: 针对大组合数取模问题 #include <iostream> using namespace std; typedef long long LL; const int N = 100010; LL f[N], g[N]; LL qpow(LL a, int b, int p){ LL res = 1 阅读全文
posted @ 2025-09-12 12:50 yFatSheep 阅读(4) 评论(0) 推荐(0)
 
求组合数
摘要: 最基础的递推法 #include <iostream> using namespace std; const int N=2010, P=1e9+7; int C[N][N]; void init(){ for(int i=0; i<N; i++) C[i][0] = 1; for(int i=1; 阅读全文
posted @ 2025-09-12 12:46 yFatSheep 阅读(7) 评论(0) 推荐(0)
 
矩阵求逆
摘要: 所以只需要将左边矩阵化成对角线有元素的矩阵就行了。 #include<iostream> #include<cstdio> #include<cmath> #define LL long long using namespace std; const int N=405,P=1e9+7; int n 阅读全文
posted @ 2025-09-12 12:44 yFatSheep 阅读(7) 评论(0) 推荐(0)
 
高斯消元法
摘要: 目的是消成上三角行列式 记住消元的顺序和步骤就好了 #include <iostream> #include <algorithm> #include <cmath> using namespace std; const int N = 110; const double eps = 1e-6; i 阅读全文
posted @ 2025-09-12 12:39 yFatSheep 阅读(7) 评论(0) 推荐(0)