算法学习
Kerin637
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
字典树结构定义板子
参考 class TrieNode { public: vector<TrieNode*> children; bool isWord; TrieNode() : isWord(false), children(26, nullptr) { } ~TrieNode() { for (auto& c : children) delete c; } };原创 2021-10-19 08:44:36 · 142 阅读 · 0 评论 -
2021.10.10 ccpc
#include <iostream> #include <bits/stdc++.h> using namespace std; #define mod 998244353 #define ll long long ll numa[100005]={0};//numa[i]当前位置往后有多少a ll fastPow(ll base,ll n){ ll ans=1;//单位元 while(n){ if(n&1) ans=(ans*base)%m原创 2021-10-11 08:25:27 · 197 阅读 · 0 评论 -
矩阵快速幂模板(解决斐波那契数列和HDU 5015 233 Matrix)
a156=a100111002=a27∗1+26∗0+25∗0+24∗1+23∗1+22∗1+21∗0+20∗0a^{156}=a^{10011100_2}=a^{2^7*1 + 2^6*0 + 2^5*0+2^4*1+2^3*1+2^2*1+2^1*0+2^0*0}a156=a100111002=a27∗1+26∗0+25∗0+24∗1+23∗1+22∗1+21∗0+20∗0 普通快速幂的模板: int fastPow(int base,int n,int mod){ int ans=1;//单原创 2021-07-17 13:49:06 · 482 阅读 · 1 评论
分享