11 2017 档案
摘要:1.读入优化 inline int read() { int ans=0,f=1;char t=getchar(); while(t<'0'||t>'9') f=(t=='-'?-1:1),t=getchar(); while(t>='0'&&t<='9') ans=ans*10+t-'0',t=g
阅读全文
摘要:基础:快速幂,矩阵乘法; 快速幂: #include<cstdio> #include<cstring> #define ll long long ll poww(ll a,ll b) { ll ans=1; while(b) { if(b&1) ans*=a; b>>=1;a*=a; } retu
阅读全文
摘要:主要是51nod上的中位数(距离之和最小): 一:1096 距离之和最小: 是一道水题; #include<cstdio> #include<cstring> #include<algorithm> using std::sort; int map[10010]; int main() { int
阅读全文
摘要:先来个模版:(P3375) #include<cstdio> #include<cstring> const int N=1000010; char a[N],b[N]; int lena,lenb,next[N]; void init() { int j=0;next[1]=0; for(int
阅读全文

浙公网安备 33010602011771号