自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(201)
  • 资源 (4)
  • 收藏
  • 关注

原创 Hello World!

我是bibibibi,额就是随便起了一个Id...年轻的时候不知道怎么想的233333平时喜欢搞搞acm算法竞赛,因为大二下才开始很投入的去搞,所以现在还比较菜...平常时间里喜欢好高骛远,加上综测原因保研无望...所以大四考研势在必行?预想是平时在博客上记录一下自己的学习进程和平时队内训练情况?(要是我能坚持下来...)upd:保研了,thu被拒了,中科院计算所见,以后会继续刷...

2017-04-02 19:17:58 399

原创 D. Graph and Queries (并查集+线段树)

题目链接:http://codeforces.com/contest/1416/problem/D应该是图上的比较经典的问题了(然而我不会用并查集把图区间化,思想是根据删除顺序的倒叙来建树,最后dfs序即可,然后用线段树维护答案代码:#include<bits/stdc++.h>#define xx first#define yy second#define mp make_pair#define pb push_backusing namespace s..

2020-10-04 13:25:30 329

原创 2020牛客暑期多校训练营(第八场)A.All-Star Game(线段树+带撤销并查集)

题目链接:https://ac.nowcoder.com/acm/contest/5673/A直接线段树维护每一个关系的生命周期,加一个带撤销并查集,然后dfs更新答案就行了题目倒是不难写,mark一个带撤销并查集的板子代码:#include<bits/stdc++.h>#define xx first#define yy second#define mp make_pair#define pb push_backusing namespace std;..

2020-10-02 23:49:37 207

原创 Codeforces Round #599 (Div. 1) C. Sum Balance(图+dp)

题目链接:https://codeforces.com/contest/1242/problem/C具体做法参照题解,记录一个子集当中dp的方法https://cp-algorithms.com/algebra/all-submasks.html代码:#include<bits/stdc++.h>#define xx first#define yy...

2019-11-25 23:07:58 190

原创 Educational Codeforces Round 7 F. The Sum of the k-th Powers(拉格朗日插值)

题目链接:https://codeforces.com/contest/622/problem/Fmark一个dls拉个朗日插值的板子代码:#include<bits/stdc++.h>#define xx first#define yy second#define mp make_pair#define pb push_backusing name...

2019-10-15 18:56:12 147

原创 Codecraft-18 and Codeforces Round #458 (Div. 1 + Div. 2, combined) G. Sum the Fibonacci(子集卷积)

题目链接:https://codeforces.com/contest/914/problem/G子集卷积+FWT的板子题,记一个子集卷积的板子代码:#include<bits/stdc++.h>#define xx first#define yy second#define mp make_pair#define pb push_backusing...

2019-10-15 09:21:05 174

原创 Manthan, Codefest 19 (open for everyone, rated, Div. 1 + Div. 2) F. Bits And Pieces(DP)

题目链接:https://codeforces.com/contest/1208/problem/F神奇的SOSdp?感觉就是数位dp啊https://codeforces.com/blog/entry/45223hint:这个题要把dp的顺序反一下代码:#include<bits/stdc++.h>#define xx first#define ...

2019-09-10 18:47:37 118

原创 Educational Codeforces Round 64 (Rated for Div. 2) E. Special Segments of Permutation(启发式合并)

题目链接:http://codeforces.com/contest/1156/problem/E启发式合并的题目,好久没碰到了,看了题解才会啊?预处理每个值作为最大值的区间,然后扫短的区间,查另一个端点落不落在长区间内就好了代码:#include<bits/stdc++.h>#define xx first#define yy second#define...

2019-05-30 22:29:24 132

原创 Forethought Future Cup - Elimination Round F. Leaf Partition(dp)

题目链接:https://codeforces.com/contest/1146/problem/Fdp[now][0]表示没有儿子和当前节点相连的方案数dp[now][1]表示只有一个儿子和当前节点相连的方案数dp[now][2]表示多个儿子和当前节点相连的方案数然后转移就很好写了代码:#include<bits/stdc++.h>#defin...

2019-04-23 10:48:23 188

原创 Educational Codeforces Round 60 (Rated for Div. 2) E. Decypher the String(构造)

题目链接:http://codeforces.com/contest/1117/problem/E 这个题还是很有意思的,注意到26^3正好是大于1e4的,可以按照26^0,26^1,26^2分块,然后判断每个位置经过变换之后到那个块中,从而得到所有的位置 代码:#include&lt;bits/stdc++.h&gt;#define xx first#define yy...

2019-02-19 21:37:12 122

原创 Codeforces Round #532 (Div. 2) F. Ivan and Burgers(线性基)

题目链接:http://codeforces.com/contest/1100/problem/F 构造线性基的同时,维护每一个基向量出现的最靠右的位置即可,然后离线所有的查询即可,第一次见这种套路 代码:#include&lt;bits/stdc++.h&gt;#define xx first#define yy second#define mp make_pair...

2019-01-14 18:03:16 233

转载 Github基本操作

参考链接:https://www.cnblogs.com/ayseeing/p/3572582.htmlhttps://www.cnblogs.com/specter45/p/github.html 其实会用下面几个命令就够了...git init //把这个目录变成Git可以管理的仓库git add README.md //文件添加到仓库git add . //不但可以...

2019-01-10 20:54:06 183

转载 判断度数序列是否可图的两种方法

转自:https://blog.csdn.net/ylsoi/article/details/85561975wiki:https://en.wikipedia.org/wiki/Havel–Hakimi_algorithmhttps://en.wikipedia.org/wiki/Erdős–Gallai_theorem注:构造的都是无限简单图,如果可以有自环,仅需要判断奇数度节...

2019-01-02 15:12:57 7276

原创 Educational Codeforces Round 57 (Rated for Div. 2) G. Lucky Tickets(NTT)

题目链接:http://codeforces.com/contest/1096/problem/G 挺容易想到NTT思路的,然后注意处理数论变换后的数组,直接进行快速幂即可,最后再进行逆变换 代码:#include&lt;bits/stdc++.h&gt;#define xx first#define yy second#define mp make_pair#def...

2018-12-29 14:19:08 312 2

原创 The 2018 ACM-ICPC Asia Qingdao Regional Contest

施工中(8/13)题目链接:https://vjudge.net/contest/269632#overview C - Flippy Sequence  队友写的,没看题 代码:#include&lt;bits/stdc++.h&gt;using namespace std;typedef long long ll;const int N = 100001...

2018-12-23 10:39:59 240

原创 2018-2019 ACM-ICPC, Asia Nanjing Regional Contest

施工中(8/13)题目链接:http://codeforces.com/gym/101981 A.Adrien and Austin 队友写的,没看题 代码:#include&lt;bits/stdc++.h&gt;using namespace std;const int MAXN=1e6+5;int n,k;void solve(){ int...

2018-12-23 10:18:49 789

原创 Codeforces Round #526 (Div. 1) C. Max Mex(线段树+LCA)

题目链接:http://codeforces.com/contest/1083/problem/C 用线段树维护树上路径,然后通过lca计算距离来合并 代码:#include&lt;bits/stdc++.h&gt;#define xx first#define yy second#define mp make_pair#define pb push_backusi...

2018-12-22 22:05:13 295

原创 BZOJ 1061 [Noi2008]志愿者招募(费用流)

题目链接:https://www.lydsy.com/JudgeOnline/problem.php?id=1061 每个时间像下一个时间连一条容量为INF-这个时间需要的人,费用为0。S向1连容量为INF,费用为0。n向T连容量为INF,费用为0。然后对于每个人,时间段为x到y,费用为z,从x到y+1连一条容量为inf,费用为z的边。然后跑最小费用最大流。 代码:#...

2018-12-18 22:55:57 118

原创 Educational Codeforces Round 56 (Rated for Div. 2) G. Multidimensional Queries(线段树)

题目链接:http://codeforces.com/contest/1093/problem/G 刚学的曼哈顿距离的技巧 代码:#include&lt;bits/stdc++.h&gt;#define xx first#define yy second#define mp make_pair#define pb push_backusing namespace s...

2018-12-17 22:04:32 123

原创 Educational Codeforces Round 56 (Rated for Div. 2) E. Intersection of Permutations(树套树)

题目链接:http://codeforces.com/contest/1093/problem/E 非常裸的带修改二维数点问题,直接树套树暴力就好了,mark一下pb_ds写法 代码:#include&lt;bits/stdc++.h&gt;#include&lt;ext/pb_ds/tree_policy.hpp&gt;#include&lt;ext/pb_ds/ass...

2018-12-17 22:01:14 152

原创 Educational Codeforces Round 55 (Rated for Div. 2) F. Speed DialI(DP)

题目链接:https://codeforces.com/contest/1082/problem/F dp[i][j][k]表示节点i还剩下j个操作,上一个操作的节点为k,把儿子节点全部覆盖的代价f[i][j][k][m]表示节点i还剩下j个操作,上一个操作的节点为k,只考虑前m个儿子的代价然后在trie上dp即可 代码:https://github.com/bibib...

2018-12-03 23:19:10 126

原创 Codeforces Round #522 (Div. 1) C. Vasya and Maximum Matching(dp)

题目链接:http://codeforces.com/contest/1078/problem/C dp[x][0]表示当前节点没有被匹配,且在后续可被匹配,可不被匹配的方案数dp[x][1]表示当前节点没有被匹配,在后续当中必须被匹配的方案数dp[x][2]表示当前节点已经被匹配的方案数 注意:如果一个儿子v已经被匹配,则当前节点可以向v连边,状态从0-&gt;1或者...

2018-11-19 20:45:16 211

原创 2018-2019 ACM-ICPC, Asia Nanjing Regional Contest E.Eva and Euro coins

题目链接:http://codeforces.com/gym/101981/attachments 我们把k个反转过来,然后周围一定有一个和这个k个不相同的,然后就变成了k+1个相同的,然后我们可以把这个两个互换位置,所以,问题就是一个祖玛游戏,每次消除连续的k个,然后看剩下的是否相同即可 代码:#include&lt;bits/stdc++.h&gt;#define xx...

2018-11-19 10:41:41 714

原创 Codeforces Round #189 (Div. 1) C. Kalila and Dimna in the Logging Industry(李超树)

题目链接:http://codeforces.com/problemset/problem/319/C 挺简单的,记一个李超树的板子 代码:#include&lt;bits/stdc++.h&gt;#define xx first#define yy second#define mp make_pair#define pb push_backusing namesp...

2018-11-06 20:52:51 174

原创 UVALive - 8139 National Disaster: Two Towers(计算几何)

题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&amp;Itemid=8&amp;page=show_problem&amp;problem=6161 毒瘤计算几何。。。判断一下每一个联通块覆盖边界的情况,看看能不能把起点和终点间隔开,并查集维护一下,需要判掉在矩形外面的联通块,如果两个圆...

2018-11-06 13:48:11 288

转载 最远曼哈顿距离求解技巧

转一个博客,mark一下 今年沈阳出了一个这种题,感觉思路挺不错的 

2018-10-24 15:56:46 1818

转载 [Aizu-1388] Counting Cycles

努力了一天没A掉????????? 转个题解吧,学会了高超的技巧,添加一堆非树边,判断能否成简单环 又努力了一天,终于A了#include&lt;bits/stdc++.h&gt;#define xx first#define yy second#define mp make_pair#define pb push_backusing namespace std;...

2018-10-22 21:29:39 248

原创 Educational Codeforces Round 52 (Rated for Div. 2) F. Up and Down the Tree(DP)

题目链接:http://codeforces.com/contest/1065/problem/F 只有两种情况,一种是访问一个子树,最终能回到当前节点,另一种是访问一个子树,最后没法回到当前节点f[i]表示离i最近的叶子节点到i的深度dp[i]表示以i为根,并且回到i,能够访问的叶子数目ans[i]表示以i为根,能访问的的最大的节点数然后dfs转移即可 代码:...

2018-10-12 20:03:37 236

原创 Educational Codeforces Round 52 (Rated for Div. 2) E. Side Transmutations(数学)

题目链接:http://codeforces.com/contest/1065/problem/E 理论推理一下,发现每一块都是相互独立的,然后分块计数就行了 代码:#include&lt;bits/stdc++.h&gt;#define xx first#define yy second#define mp make_pair#define pb push_back...

2018-10-12 14:47:07 190

原创 ACM-ICPC 2018 焦作赛区网络预赛 F.Modular Production Line(费用流)

题目链接:https://nanti.jisuanke.com/t/31715 和poj3680是一样的啊?好像就是个差分约束系统然后跑个网络流啊? 代码:#include&lt;bits/stdc++.h&gt;#define xx first#define yy second#define mp make_pair#define pb push_backusin...

2018-09-16 09:45:03 187

原创 hihoCoder #1429 : A New Ground Heating Device (圆的k次交)

题目链接:http://hihocoder.com/problemset/problem/1429?sid=1370496 当年北京的银牌题,比较板,二分高度跑圆的k次交就好了 代码:#include&lt;bits/stdc++.h&gt;#define xx first#define yy second#define mp make_pair#define pb ...

2018-09-14 15:48:47 417

原创 bzoj 2618: [Cqoi2006]凸多边形 (半平面交)

题目链接:https://www.lydsy.com/JudgeOnline/problem.php?id=2618 半平面交的板题 代码:#include&lt;bits/stdc++.h&gt;#define xx first#define yy second#define mp make_pair#define pb push_backusing namesp...

2018-09-12 16:25:22 117

原创 Educational Codeforces Round 47 (Rated for Div. 2) F. Dominant Indices(dsu on tree)

题目链接:http://codeforces.com/contest/1009/problem/F 出题人的黑科技,貌似子树中的静态查询问题都可以这么用啊?http://codeforces.com/blog/entry/44351 代码:#include&lt;bits/stdc++.h&gt;#define mp make_pair#define pb push_...

2018-07-25 21:27:27 209

原创 Educational Codeforces Round 46 (Rated for Div. 2) F. One Occurrence(线段树)

题目链接:http://codeforces.com/contest/1000/problem/F按照位置维护,类似于区间出现的不同的数的做法,首先把所有的查询离线,然后每次更新的时候,设位置为i的数为a[i],然后我们将右边最近的a[i]的位置j更新为0,然后将位置i更新为j,查询的时候查找区间当中第一个大于R的位置。代码:#include&lt;bits/stdc++.h&gt;using ...

2018-07-01 21:51:42 239

原创 Educational Codeforces Round 46 (Rated for Div. 2) E. We Need More Bosses(边双联通分量)

题目链接:http://codeforces.com/contest/1000/problem/E直接点双跑出来,然后图就变成了一棵树,然后跑树的直径,就是答案,题目描述挺迷的。。。代码:#include&lt;bits/stdc++.h&gt;#define pb push_backusing namespace std;const int MAXN=3e5+5;//点数const in...

2018-07-01 21:45:39 304

原创 "字节跳动杯"2018中国大学生程序设计竞赛-女生专场

(6/11)施工施工... A.口算训练 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6287 题解给的根号的分解素因子,其实能够做到log,然后维护每个因子在序列中出现的位置,每次二分查找就好了,zz的我最开始写了个3个log的线段树,被卡成狗了 跑得飞快系列233333 代码:#include&lt...

2018-05-31 17:28:21 2385

原创 Avito Code Challenge 2018 G. Magic multisets(线段树)

题目链接:http://codeforces.com/contest/981/problem/G线段树维护乘法和加法,对于每次修改,首先将区间[l,r]都乘2,然后查询[l,r]当中有哪些子区间没有出现过x,对这部分区间乘INV2(2的逆元)并且加1,查询子区间可以用set维护代码:#include&lt;bits/stdc++.h&gt;#define mp make_pair#define...

2018-05-30 22:31:54 377

原创 Codeforces Round #485 (Div. 1) C. AND Graph(dfs)

题目链接:http://codeforces.com/contest/986/problem/C大力dfs,考虑一个点i,则((1&lt;&lt;n)^i)所有包含1的子集,都和i连边,所以,每次暴力dfs某个点的所有子集,大力就能过了...代码:#include&lt;bits/stdc++.h&gt;using namespace std;const int MAXN=(1&lt;&lt;...

2018-05-30 20:19:53 200

原创 Avito Code Challenge 2018 E. Addition on Segments(线段树+背包)

题目链接:http://codeforces.com/contest/981/problem/E线段树维护每个询问,然后统计每个区间中出现了多少个点,一边下放标记一边做01背包即可,当然,一看数据是1e4就知道这题不简单,bitset了解一下代码:#include&lt;bits/stdc++.h&gt;#define pb push_backusing namespace std;cons...

2018-05-28 17:44:46 306

原创 Avito Code Challenge 2018 D. Bookshelves(贪心+bfs)

题目链接:http://codeforces.com/contest/981/problem/D假设答案为ans,则一定从1走k步到n,每条边&amp;ans的值为ans,边的权重为区间的和,然后贪心从高位枚举,如果这一位可以为1,则把这一位赋值为1,最后即可得到答案代码:#include&lt;bits/stdc++.h&gt;using namespace std;const int MA...

2018-05-28 12:41:41 360

Grammarly应用程序

一个比较好用的word插件............................

2019-01-13

数字图像处理第二版

冈萨雷斯的数字图像处理的第二版pdf。。。。。。。。。

2019-01-13

国科大矩阵分析与应用参考教材

2018-2019学期国科大矩阵分析与应用的ppt参考教材,ppt大部分内容都是该书上的内容

2019-01-13

统计学习方法

李航的统计学习方法,较为清晰版本,无书签。。。。。

2019-01-13

空空如也

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

TA关注的人

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