自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 板子

#include #include #include #include #include #include #include #include #include #include using namespace std; #define mem(a,value) memset(a, value , sizeof(a)) #define ltree 2*id,ll,mid #define rtre

2018-01-21 10:58:29 156

原创 最长公共子序列(LCS)

#include #include #include #include #include #include #include #include #include using namespace std; #define MEM(a,value) memset(a, value , sizeof(a)) typedef long long ll; typedef unsigned long lo

2018-01-24 15:25:40 153

原创 最短路(Dijkstra)

//改数据范围 //不能跑有换图 int dis[210],mapp[210][210],vis[210]; int n,m; void init(){ for(int i=0;i<n;i++) for(int j=0;j<n;j++) if(i==j) mapp[i][j]=0; e

2018-01-24 14:46:33 167

原创 最长上升子序列(nlogn)

#include #include #include #include #include #include #include #include #include using namespace std; #define MEM(a,value) memset(a, value , sizeof(a)) typedef long long ll; typedef unsigned long lo

2018-01-20 17:24:02 208

原创 CF7C 拓展gcd

#include using namespace std; typedef long long ll; void exgcd(ll a,ll b,ll &x,ll &y){ if(b){ exgcd(b,a%b,y,x); y-=(a/b)*x; } else{ x=1; y=0; } } ll

2018-01-20 12:30:26 266

原创 快速幂

ll pow(ll a,ll b,ll c){ ll ans=1; a%=c; while(b){ if(b&1) ans = (ans*a)%c; b>>=1; a = (a*a)%c; } return ans; }

2018-01-06 20:52:39 123

原创 GCD模版

ll gcd(ll a,ll b){ return b?gcd(b,a%b):a; }

2017-08-23 20:21:56 245

原创 线段树总结

线段树模版主要是由Build函数,Query函数,updata函数,pushdown函数组成 //Build函数 void Build(int id,int ll,int rr){ lazy[id]=0; //lazy数组的作用是存放区间变化的值,在单点更新的时候可以忽略 if(ll==rr){ s[id]=1; return;

2017-08-22 21:00:43 167

原创 POJ-3070 Fibonacci

#include struct mat{ int v[3][3]; }m; mat mtmul(mat A,mat B){ mat C; int M=10000; C.v[0][0] = (A.v[0][0]*B.v[0][0] + A.v[0][1]*B.v[1][0]) % M; C.v[0][1] = (A.v[0][0]*B.v[0][1] +

2017-08-22 20:53:28 245

原创 POJ - 3264 Balanced Lineup

#include int a[200000]; struct node{ int maxx,minn; }s[800000]; int max(int a,int b){ if(a>b) return a; return b; } int min(int a,int b){ if(a<b) return a; retu

2017-08-22 20:48:20 228

原创 HDU - 1698 Just a Hook

#include using namespace std; int s[400005],lazy[400005]; void pushdown(int id,int l,int r){ int mid=(l+r)/2; int ls=id*2,rs=id*2+1; lazy[ls]=lazy[rs]=lazy[id]; s[ls]=(mid-l+1)*lazy[

2017-08-22 20:47:42 145

原创 POJ - 3468 A Simple Problem with Integers

#include long long s[400005],a[100005]; long long addlazy[400005]; void pushdown(long long id,long long ll,long long rr){ long long mid=(ll+rr)>>1; long long ls=id*2,rs=id*2+1; addlazy[l

2017-08-22 12:39:02 131

原创 HDU - 1754 I Hate It

#include using namespace std; int s[800005]; int a[200005]; void build(int id,int ll,int rr){ if(ll==rr){ s[id]=a[ll]; return; } int mid = (ll+rr)/2; build(id*2,ll,m

2017-08-22 12:38:02 162

原创 HDU - 1166 敌兵布阵

#include int s[200005]; int addlazy[200005]; int a[50005]; void pushdown(int id,int ll,int rr){ int mid=(ll+rr)/2; int ls=2*id,rs=2*id+1; addlazy[ls]+=addlazy[id]; addlazy[rs]+=addla

2017-08-22 12:36:58 151

原创 POJ3252-Round Numbers

#include #include int a[100]; int dp[100][100][100]; int dfs(int pos,int cot0,int cot1,int lead,bool limit){     if(pos==-1){         if(cot0>=cot1)  return 1;         if(lead==0) retur

2017-08-21 09:25:02 167

原创 HDU2089 不要62

#include using namespace std; int a[20]; int dp[20][2]; int dfs(int pos,int pre,int sta,bool limit){     if(pos == -1)         return 1;     if(!limit && dp[pos][sta]!=-1)

2017-08-21 09:18:31 150

空空如也

空空如也

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

TA关注的人

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