摘要: Like everyone else, cows like to stand close to their friends when queuing for feed. FJ has N (2 <= N <= 1,000) cows numbered 1..N standing along a st 阅读全文
posted @ 2019-11-06 20:56 蓉~ 阅读(407) 评论(0) 推荐(0) 编辑
摘要: 传说在遥远的地方有一个非常富裕的村落,有一天,村长决定进行制度改革:重新分配房子。这可是一件大事,关系到人民的住房问题啊。村里共有n间房间,刚好有n家老百姓,考虑到每家都要有房住(如果有老百姓没房子住的话,容易引起不安定因素),每家必须分配到一间房子且只能得到一间房子。另一方面,村长和另外的村领导希 阅读全文
posted @ 2019-11-04 20:48 蓉~ 阅读(151) 评论(0) 推荐(0) 编辑
摘要: You are given an array aa consisting of nn integers. Your task is to say the number of such positive integers xx such that xx divides each number from 阅读全文
posted @ 2019-10-31 20:09 蓉~ 阅读(148) 评论(0) 推荐(0) 编辑
摘要: On Octorber 21st, HDU 50-year-celebration, 50-color balloons floating around the campus, it's so nice, isn't it? To celebrate this meaningful day, the 阅读全文
posted @ 2019-10-31 20:04 蓉~ 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 匈牙利算法 增广路求最大匹配的方法 https://blog.csdn.net/sunny_hun/article/details/80627351(形象生动) 最大独立集问题 如果U定义了G的一个完全子图,则它也定义了的一个空子图,反之亦然。所以在G的完备子图与的独立集之间有对应关系。特别的,G的 阅读全文
posted @ 2019-10-29 20:19 蓉~ 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 引理:积的取余=取余的积的取余 模板: &是AND运算符,是一种逻辑运算符。 其运算规则如下: 1&1=1;真&&真=真。 1&0=0;真&&假=假。 0&1=0;假&&真=假。 0&0=0;假&&假=假。 阅读全文
posted @ 2019-10-18 20:57 蓉~ 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 魔卡少女樱CLEAR CARD篇,小樱都上初中了,她说要好好学数学。她有一道作业题是这样的:给你一个数列,要你写出其一个子数列,这个子数列的要求是连续且和最大,如果有多条子数列和一样大就取最前面的一条。例如,对于数列(-5,6,-1,5,4,-7),就取第2位到第5位这一段,总和为:6 + (-1) 阅读全文
posted @ 2019-10-17 16:27 蓉~ 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 10.8 c https://vjudge.net/contest/332874#problem/C 10.9 https://vjudge.net/contest/333223#problem/B 这道题考查的是最短路,floyd算法的应用 由于对于任意一条至少包含两条边的路径i--j,一定存在一 阅读全文
posted @ 2019-10-17 16:18 蓉~ 阅读(156) 评论(0) 推荐(0) 编辑
摘要: Manacher 马拉车算法就是求解最长回文串 并且将时间复杂度降到了O(n), 它的原理就是将原始字符串进行了处理,在每一个字符的左右两边都加上特殊字符,让字符串变成一个奇回文 然后通过数组储存标记,详细看这篇https://www.jianshu.com/p/392172762e55 回文自动机 阅读全文
posted @ 2019-09-26 18:08 蓉~ 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 2019中国大学生程序设计竞赛(CCPC) - 网络选拔赛 A - ^&^ Bit operation is a common computing method in computer science ,Now we have two positive integers Aand B ,Please 阅读全文
posted @ 2019-09-23 10:38 蓉~ 阅读(261) 评论(0) 推荐(0) 编辑