自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(11)
  • 收藏
  • 关注

原创 记录个人在洛谷试练场做题历程:二分答案:膨胀的木棍

http://noi.openjudge.cn/ch0111/09/#include<cstdio>#include<cmath>using namespace std;int main(){ double l,n,c,L; scanf("%lf%lf%lf",&l,&n,&c); L=l*(1+n*c); double le=0....

2018-04-01 18:04:26 524

原创 记录个人在洛谷试练场做题历程:模拟,玩具谜题

https://www.luogu.org/problemnew/show/P1563#include<cstdio>#include<cstring>#include<algorithm>using namespace std;struct node { char s[11]; int di;}a[100010];int main(){ int n,m,d,l...

2018-04-01 17:38:20 622

原创 解决乘法逆元的三种方法

1、拓展欧几里得#include<bits/stdc++.h>#define ll long longusing namespace std;ll n,p,x,y;void exgcd(ll a,ll b,ll &x,ll &y){ if(b==0){ x=1; y=0; return; } exgcd(b,a%b,x,y); ll t...

2018-02-14 18:46:55 951

原创 KMP:字符串匹配

#include<bits/stdc++.h>using namespace std;int next[1000005];char a[1000005],b[1000005];int main(){ scanf("%s%s",&a,&b); int lena=strlen(a),lenb=strlen(b); int i=0,j=-1; next[0]=-1; whil...

2018-02-14 17:07:28 154

原创 线段树:区间修改,区间求和

#include<cstdio>#define ll long longusing namespace std;const int M=400001;int n,m,k,x,y,val;ll a[M],sum[M],lazy[M];void pushup(int index){    sum[index]=sum[index<<1]+sum[index<<1|1...

2018-02-14 15:25:40 190

原创 hash:RK算法字符串匹配

#include<bits/stdc++.h>using namespace std;const int d=26,q=144451;int A,B,lena,lenb,h=1; char a[101],b[101];//a为主串,b为匹配串 int match(int index){ for(int i=index,j=0;i<lenb&&j<lenb;+...

2018-02-14 15:16:04 740

原创 树状数组(区间更新,区间查询)

#includeusing namespace std;const int M=500005;int a[M],c[M],c1[M],c2[M];int n,m,k,x,y,z;int lowbit(int t){    return t&(-t);}void update(int l,int r,int val){    for(int i=l;i

2018-02-03 18:41:48 153

原创 树状数组(区间更新,单点查询)

#includeusing namespace std;const int M=500005;int a[M],c[M],c1[M];int n,m;int lowbit(int t){return t&(-t);}void update(int l,int r,int val){//区间更新只相当于更新c[l]+=val,c[r+1]-=val;下面为

2018-02-03 17:39:33 358

翻译 树状数组(单点更新,区间查询)

#includeusing namespace std;int n,m,k,x,y,sum;int a[500005],c[500005];int lowbit(int t){return t&(-t);}void update(int x,int val){for(int i=x;i{c[i]+=val;}}void getsum(in

2018-02-03 11:11:51 278

原创 RMQ求LCA

#include#include#include#include#includeusing namespace std;const int M=500001;int n,m,s,a,b;int f[M*2],d[M*2],l[M*2],dfn;bool vis[2*M];int dp[2*M][20],pos[2*M][20];struct node

2017-12-28 18:07:25 169

原创 targan求LCA

#include#include#include#includeusing namespace std;const int M=1000000+10;struct edge{int next,to;}tree[M];struct node {int next,to,index;}que[M];bool vis[M];int n,m,s,a

2017-12-10 17:47:20 342 2

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除