自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 hdu 6394

题目描述:给一棵树,每个点上有一个值,代表可向上跳这么多步,问需要几次能跳出树1:查询  2:修改 x 的权值为y做法: lct +倍增在该点可以调到的下一个点连一条边连一条边,用n+1代表终点,查找x到n+1的路径上有几个点(access后的splay)#include <iostream>#include <cstdio>#include <...

2018-09-09 23:07:11 167

原创 bzoj 1101

对于给定的整数a,b和d,有多少正整数对x,y,满足x<=a,y<=b,并且gcd(x,y)=d。作为FGD的同学,FGD希望得到你的帮助(1<=d<=a,b<=50000)(1<=n<= 50000)#include <bits/stdc++.h>using namespace std;typedef long long ll;...

2018-09-01 00:14:20 151

原创 hdu 5886

求删除树上每一条边之后形成的两个子树中树的直径大者的和#include <bits/stdc++.h>using namespace std;typedef long long ll;const int maxn = 1e5+10;struct edge { int from,to,dist; edge(int a=0,int b=0,in...

2018-08-27 11:13:47 194

原创 笛卡尔树

#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>#include <set>#include <stack>using namespace std;typedef long long ll;const int...

2018-07-26 19:18:49 149

原创 hdu 5039 未通过

#include <iostream>#include <cstdio>#include <cstring>#include <vector>#include <algorithm>#include <string>#include <map>using namespace std;const i

2018-07-25 12:00:04 126

原创 hdu 6299 多校1002

去除掉每个串原有的匹配括号以后, 可以分成三种 1.(((    2.))))   3.)))..((贪心很容易将1,2放在最前和最后 对于第三种我们会希望'('比')'多的类型放在左面,同理另一种放在右面对于3中‘(‘ 比 ’)’多的类型,‘)’多的放在后面这样‘)’会和前面的‘(’尽可能的匹配,而剩下的前面剩下的‘(’会和3里面剩下‘)’尽可能的匹配(目前这样想的,可能有误) ...

2018-07-24 16:04:42 101

原创 1004尚未通过

#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>#include <set>using namespace std;const int maxn = 2e5+10;int a[maxn];struct line {  ...

2018-07-23 21:56:14 256

原创 bzoj1023 仙人掌图

#include <iostream>#include <cstdio>#include <algorithm>#include <vector>#include <cstring> using namespace std;const int maxn = 50000+10;const int INF = 0x3f3f3f...

2018-07-18 17:30:44 173

原创 树链剖分模板

#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>using namespace std;const int maxn = 30000+10;const int INF = 0x3f3f3f3f;struct edge {      ...

2018-07-18 17:29:15 88

原创 bzoj1010 斜率优化

#include <iostream>#include <cstring>#include <cstdio>#include <queue>using namespace std;typedef long long ll;const int maxn = 50000+10;ll dp[maxn],s[maxn],q[maxn];double cal(...

2018-07-15 20:30:30 113

原创 hdu-4268 贪心+set

set可以快速的插入和删除#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <queue>#include <algorithm>#include <set>using namespace std;cons

2018-07-12 17:25:50 247

原创 poj 3580 (splay 模板)

//本来用指针的那种写法,wa了20多次受不了了,看了一个大佬的博客,代码基本照抄,只不过将splay时pushdown(x)修该到Rotate里面#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>using namespace std;const in...

2018-05-29 23:38:48 230

原创 hdu5117 (dp期望+数学展开)

题意:n个开关,每个控制一些灯,最后求E[X3] × 2M mod (109 + 7)思路 : 另xi代表每个灯的状态,原始等价(x1+x2+..xn)(x1+..xn)(x1+..xn),乘2的M次方等价于对开关的每一种选择结果直接加上和,即对每一种开关状态所有xi*xj*xk不为一累加上即可,因此对 xi*xj*xk可反求有多少种控制方式使得结果为一,dp。最后可枚举每项前系数来节省时间,当i...

2018-05-21 21:30:22 303

原创 旋转卡壳LA4728

#include <iostream>#include <cstdio>#include <cstring>#include <cmath>#include <algorithm>using namespace std;int n,t,x,y,z,r,kase = 0;const int maxn = 4*1e6+10;...

2018-02-10 19:13:03 164

空空如也

空空如也

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

TA关注的人

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