随笔分类 - 数学——矩阵相关
摘要:对于一个在位置 $i$ 的数,他等于 $i^k+sum_{1,k 1}$。 二项式定理推 $i^k$,矩阵快速幂即可。 cpp include include using namespace std; typedef long long ll; int k, c[15][15]; ll n; con
阅读全文
摘要:一列一列地推就可以了 cpp include include using namespace std; typedef long long ll; int n, m; const int mod=10000007; struct Matrix{ int num[15][15]; Matrix ope
阅读全文
摘要:分治即可 当然也可以把矩阵看成元素用矩阵快速幂做 cpp include include using namespace std; int n, k, m; struct Matrix{ int num[35][35]; Matrix operator (const Matrix &x)const{
阅读全文
摘要:```cpp include include include using namespace std; int n, x; double a[55][55]; const double eps=1e 7; void gauss(){ for(int i=1; ia[maxi][i]) maxi =
阅读全文
摘要:```cpp include include include include using namespace std; int n, x; double a[105][105]; bool gauss(){ for(int i=1; ifabs(a[maxi][i])) maxi = j; if(f
阅读全文
摘要:upd:现在推荐使用一个长度为 $n$ 的一维向量。若状态矩阵 $F$ 对下一时间的状态矩阵 $F'$ 有影响,则 $F'=FA$ 中的 转移矩阵 $A$ 的赋值方法是: 若状态矩阵中的第 $x$ 个数对下一单位时间的状态矩阵的第 $y$ 个数有影响,则将转移矩阵的第 $x$ 行第 $y$ 列赋值为
阅读全文
摘要:```cpp include include using namespace std; typedef long long ll; ll k; const ll mod=1e9+7; struct Matrix{ int n; ll num[105][105]; Matrix operator (c
阅读全文

浙公网安备 33010602011771号