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 阅读全文
posted @ 2017-11-07 13:20 12fs 阅读(229) 评论(0) 推荐(0)
摘要:基础:快速幂,矩阵乘法; 快速幂: #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 阅读全文
posted @ 2017-11-05 22:00 12fs 阅读(205) 评论(0) 推荐(0)
摘要:主要是51nod上的中位数(距离之和最小): 一:1096 距离之和最小: 是一道水题; #include<cstdio> #include<cstring> #include<algorithm> using std::sort; int map[10010]; int main() { int 阅读全文
posted @ 2017-11-05 21:39 12fs 阅读(384) 评论(0) 推荐(0)
摘要:先来个模版:(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 阅读全文
posted @ 2017-11-05 21:18 12fs 阅读(154) 评论(0) 推荐(0)