随笔分类 -  算法基础—暴力枚举/剪枝

摘要:Acacius is studying strings theory. Today he came with the following problem. You are given a string ss of length nn consisting of lowercase English l 阅读全文
posted @ 2020-07-19 21:07 脂环 阅读(453) 评论(0) 推荐(0) 编辑
摘要:Among Johnny's numerous hobbies, there are two seemingly harmless ones: applying bitwise operations and sneaking into his dad's office. As it is usual 阅读全文
posted @ 2020-06-07 21:33 脂环 阅读(305) 评论(0) 推荐(0) 编辑
摘要:Let's define the following recurrence: an+1=an+minDigit(an)⋅maxDigit(an).an+1=an+minDigit(an)⋅maxDigit(an). Here minDigit(x)minDigit(x) and maxDigit(x 阅读全文
posted @ 2020-05-16 23:10 脂环 阅读(528) 评论(0) 推荐(0) 编辑
摘要:题目描述 Xenia is a girl being born a noble. Due to the inflexibility and harshness of her family, Xenia has to find some ways to amuse herself. Recently 阅读全文
posted @ 2020-04-16 20:37 脂环 阅读(258) 评论(0) 推荐(0) 编辑
摘要:问题描述 小明这些天一直在思考这样一个奇怪而有趣的问题: 在1~N的某个全排列中有多少个连号区间呢?这里所说的连号区间的定义是: 如果区间[L, R] 里的所有元素(即此排列的第L个到第R个元素)递增排序后能得到一个长度为R-L+1的“连续”数列,则称这个区间连号区间。 当N很小的时候,小明可以很快 阅读全文
posted @ 2020-03-12 11:48 脂环 阅读(212) 评论(0) 推荐(0) 编辑
摘要:You are given an array aa of length nn and array bb of length mm both consisting of only integers 00 and 11 . Consider a matrix cc of size n×mn×m form 阅读全文
posted @ 2020-03-08 15:53 脂环 阅读(217) 评论(0) 推荐(0) 编辑
摘要:题目描述 人类终于登上了火星的土地并且见到了神秘的火星人。人类和火星人都无法理解对方的语言,但是我们的科学家发明了一种用数字交流的方法。这种交流方法是这样的,首先,火星人把一个非常大的数字告诉人类科学家,科学家破解这个数字的含义后,再把一个很小的数字加到这个大数上面,把结果告诉火星人,作为人类的回答 阅读全文
posted @ 2020-03-04 21:21 脂环 阅读(268) 评论(0) 推荐(0) 编辑
摘要:You are given a string ss consisting of lowercase Latin letters. Let the length of ss be |s||s| . You may perform several operations on this string. I 阅读全文
posted @ 2020-03-03 00:59 脂环 阅读(202) 评论(0) 推荐(0) 编辑
摘要:You are given three integers a≤b≤ca≤b≤c . In one move, you can add +1+1 or −1−1 to any of these integers (i.e. increase or decrease any number by one) 阅读全文
posted @ 2020-02-27 23:55 脂环 阅读(149) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示
主题色彩