07 2019 档案

摘要:Kadane Algorithm 求一个数组里连续子序列的和最大。 A. Flipping Game Description Iahub got bored, so he invented a game to be played on paper. He writes n integers a1,  阅读全文
posted @ 2019-07-30 15:18 kaike 阅读(294) 评论(0) 推荐(0) 编辑
摘要:A. Boredom A. Boredom Alex doesn't like boredom. That's why whenever he gets bored, he comes up with games. One long winter evening he came up with a 阅读全文
posted @ 2019-07-28 19:40 kaike 阅读(197) 评论(0) 推荐(0) 编辑
摘要:D2. RGB Substring (hard version) Description The only difference between easy and hard versions is the size of the input. You are given a string ss co 阅读全文
posted @ 2019-07-26 15:19 kaike 阅读(305) 评论(0) 推荐(0) 编辑
摘要:题目链接 A:Equivalent Prefixes 给你两个长度为n的序列a、b,求一个最大k值使,i-k 中任意一个区间的最小值下标都相同 我们用单调栈处理每个元素作为最小值的左端点。 我们把下标放进栈中,比较的时候比较具体的值,维护一个值逐渐变大的单调栈。 若当前栈为空,则说明没有比当前值更小 阅读全文
posted @ 2019-07-26 13:56 kaike 阅读(217) 评论(0) 推荐(0) 编辑
摘要:D2. Submarine in the Rybinsk Sea (hard edition) Description This problem differs from the previous one only in the absence of the constraint on the eq 阅读全文
posted @ 2019-07-21 09:01 kaike 阅读(445) 评论(0) 推荐(0) 编辑
摘要:这其实也是一种数据结构。 阅读全文
posted @ 2019-07-15 15:01 kaike 阅读(172) 评论(0) 推荐(0) 编辑
摘要:先抄个模板 EK: 1 const int MAXN = 430; 2 const int MAX_INT = (1 << 30); 3 4 struct Edge{ 5 int v, nxt, w; 6 }; 7 8 struct Node{ 9 int v, id; 10 }; 11 12 in 阅读全文
posted @ 2019-07-11 08:52 kaike 阅读(201) 评论(0) 推荐(0) 编辑
摘要:二分图的定义,以及判断图是否为二分图都很简单了。 现在要说二分图的最大匹配。 首先是定义吧,完美匹配就是一一对应,而最大匹配则是最大可以匹配的条数 完美匹配一定是最大匹配,图中不一定都有完美匹配。 第二个就是ans的定义不是有几种不同的匹配方案,而是匹配数。 当ans〉=一边端点时,才有一个完美匹配 阅读全文
posted @ 2019-07-09 16:47 kaike 阅读(205) 评论(0) 推荐(0) 编辑
摘要:Summer Holiday Description 听说lcy帮大家预定了新马泰7日游,Wiskey真是高兴的夜不能寐啊,他想着得快点把这消息告诉大家,虽然他手上有所有人的联系方式,但是一个一个联系过去实在太耗时间和电话费了。他知道其他人也有一些别人的联系方式,这样他可以通知其他人,再让其他人帮忙 阅读全文
posted @ 2019-07-06 20:24 kaike 阅读(234) 评论(0) 推荐(0) 编辑
摘要:暂时不知道这玩意怎么用,暂时不知道啥时候用这玩意.... 在有向图G中,如果两点互相可达,则称这两个点强连通,如果G中任意两点互相可达,则称G是强连通图。 定理: 1、一个有向图是强连通的,当且仅当G中有一个回路,它至少包含每个节点一次。 2、非强连通有向图的极大强连通子图,称为强连通分量(SCC即 阅读全文
posted @ 2019-07-06 19:53 kaike 阅读(342) 评论(0) 推荐(0) 编辑
摘要:大概就是一个 n*n 的矩阵A 求 A^k 的矩阵。 按照快速幂的思想来写。 阅读全文
posted @ 2019-07-04 13:09 kaike 阅读(155) 评论(0) 推荐(0) 编辑
摘要:Educational Codeforces Round 5 D. Longest k-Good Segment Description The array a with n integers is given. Let's call the sequence of one or more cons 阅读全文
posted @ 2019-07-04 10:00 kaike 阅读(182) 评论(0) 推荐(0) 编辑
摘要:Codeforces Round #571 (Div. 2) D. Vus the Cossack and Numbers Description Vus the Cossack has nn real numbers aiai. It is known that the sum of all nu 阅读全文
posted @ 2019-07-03 09:38 kaike 阅读(289) 评论(0) 推荐(0) 编辑
摘要:引入 离散化,就是把一些很离散的点给重新分配。 举个例子,如果一个坐标轴很长(>1e10),给你1e4个坐标,询问某一个点,坐标比它小的点有多少。 很容易就知道,对于1e4个点,我们不必把他们在坐标轴上的位置都表示出来,因为我们比较有多少比它小的话,只需要知道他们之间的相对大小就可以,而不是绝对大小 阅读全文
posted @ 2019-07-01 13:53 kaike 阅读(182) 评论(0) 推荐(0) 编辑
摘要:小Z的袜子 Description 作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿。终于有一天,小Z再也无法忍受这恼人的找袜子过程,于是他决定听天由命……具体来说,小Z把这N只袜子从1到N编号,然后从编号L到R(L 尽管小Z并不在意两只袜子是不是完整的一双,甚至不在 阅读全文
posted @ 2019-07-01 09:47 kaike 阅读(153) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示