模板
OIerGH
某OIER
展开
-
{模板}高精度压位
乘:procedure c1(x:longint); var i,j,k:longint; y:int64; begin y:=0; for i:=1 to ans[0] do begin ans[i]:=ans[i]*x+y; y:=ans[i] div mo; ans[i]:=ans[i] m原创 2016-10-06 16:12:51 · 730 阅读 · 0 评论 -
{模板}spfa
code:void spfa() { int h=1,t=1,i,j,k; d[1]=1; dis[1]=0; bz[1]=true; while (h<=t) { int l=d[h]; i=g[l];//前向新 while (a[i][0]==l) { int原创 2016-10-06 21:40:58 · 362 阅读 · 0 评论 -
{模板}快速幂
code:long long mi(long long x,long long l) { long long y; if (x==1) return(l); if (x%2==1) { long long s=mi(x/2,l); y=(s*s*l); } else { long long s=m原创 2016-10-06 21:56:14 · 221 阅读 · 0 评论 -
{模板}AC Automaton
hdu2222 code #include <cstdio> #include <cstring> #include <algorithm> #include <queue> using namespace std; const int N=1e6+10,M=1e6+10; queue<int> d; char s[N]; int...原创 2018-07-02 15:14:34 · 217 阅读 · 0 评论