随笔分类 -  模版 / 数学(模板)

【模板】线性求逆元
摘要:#include <bits/stdc++.h> using namespace std; #define LL long long const int N = 3e6+10; int n; LL p, inv[N]; int main() { scanf("%d%lld", &n, &p); in 阅读全文
posted @ 2024-11-29 15:14 Ueesugi_sakura 阅读(9) 评论(0) 推荐(0)
【模板】exgcd
摘要:#include <bits/stdc++.h> using namespace std; #define int long long const int N=1e6+10; int T,a,b,c,d,x,y,num; int exgcd(int a,int b,int &x,int &y) { 阅读全文
posted @ 2024-11-29 14:49 Ueesugi_sakura 阅读(30) 评论(0) 推荐(0)
【模板】叉积
摘要:#include <bits/stdc++.h> using namespace std; const double eps=1e-8; struct node { int x,y; }p[4]; bool cmp1(node a,node b) { if(a.x != b.x) return a. 阅读全文
posted @ 2024-11-27 09:22 Ueesugi_sakura 阅读(9) 评论(0) 推荐(0)