摘要:
中国剩余定理 CRT 定义 CRT 问题的解决方法 代码 模板题 P1495 【模板】中国剩余定理(CRT)/ 曹冲养猪 #include<bits/stdc++.h> using namespace std; long long mod[0],yu[20]; long long M=1; long 阅读全文
摘要:
一维树状数组 1. 单点修改,区间查询 #include<bits/stdc++.h> using namespace std; long long n,q; long long a[1000100],c[1000100]; long long lowbit(long long x) { retur 阅读全文
摘要:
C 组合数(杨辉三角形//递推) #include<bits/stdc++.h> using namespace std; int c[10010][110]; int mod=10007; int main() { int n,m; c[1][1]=1; c[2][1]=2; cin>>n>>m; 阅读全文
摘要:
Prim #include<bits/stdc++.h> using namespace std; struct edge { int v,w,next; }e[200005<<1]; int head[5005],dis[5005],cnt,n,m,tot,now=1,ans,inf=123456 阅读全文
摘要:
矩阵乘法 #include<bits/stdc++.h> using namespace std; int a[110][110],b[110][110],c[110][110]; int n,m,k; int main() { cin>>n>>k; for(int i=1;i<=n;i++) { 阅读全文
摘要:
spfa #include <bits/stdc++.h> using namespace std; int dis[500010], n, m, x, y, w, t = 1, s, h, head[500010], tot; bool v[100010]; queue<int> q;//手写队列 阅读全文