上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 46 下一页
摘要: 链接:https://www.nowcoder.com/acm/contest/139/J来源:牛客网题目描述Given a sequence of integers a1, a2, ..., an and q pairs of integers (l1, r1), (l2, r2), ..., ( 阅读全文
posted @ 2018-07-30 09:06 楼主好菜啊 阅读(1877) 评论(0) 推荐(0)
摘要: 链接:https://www.nowcoder.com/acm/contest/131/B来源:牛客网 题目描述 矩阵 M 包含 R 行 C 列,第 i 行第 j 列的值为 Mi,j。 请寻找一个子矩阵,使得这个子矩阵的和最大,且满足以下三个条件: 子矩阵的行数不能超过 X 行。 子矩阵的列数不能超 阅读全文
posted @ 2018-07-29 00:02 楼主好菜啊 阅读(264) 评论(0) 推荐(0)
摘要: 链接:https://www.nowcoder.com/acm/contest/141/E来源:牛客网 题目描述 Eddy likes to play with string which is a sequence of characters. One day, Eddy has played wi 阅读全文
posted @ 2018-07-28 10:39 楼主好菜啊 阅读(183) 评论(0) 推荐(0)
摘要: 哈利波特在魔法学校的必修课之一就是学习魔咒。据说魔法世界有100000种不同的魔咒,哈利很难全部记住,但是为了对抗强敌,他必须在危急时刻能够调用任何一个需要的魔咒,所以他需要你的帮助。 给你一部魔咒词典。当哈利听到一个魔咒时,你的程序必须告诉他那个魔咒的功能;当哈利需要某个功能但不知道该用什么魔咒时 阅读全文
posted @ 2018-07-28 08:45 楼主好菜啊 阅读(482) 评论(0) 推荐(0)
摘要: Censor frog is now a editor to censor so-called sensitive words (敏感词). She has a long text p . Her job is relatively simple -- just to find the first 阅读全文
posted @ 2018-07-27 23:55 楼主好菜啊 阅读(186) 评论(0) 推荐(0)
摘要: #include #include #include #include using namespace std; typedef long long ll; pairpp; pair Hash(ll a[21]) { ll ans1=0,ans2=0; for(ll i=0;i<21;i++) ans1=(ans1*1000000013+a[i])%1000000007; for(ll... 阅读全文
posted @ 2018-07-27 18:54 楼主好菜啊 阅读(520) 评论(0) 推荐(0)
摘要: 百度文库 : https://wenku.baidu.com/view/b7d3d1c6804d2b160a4ec090.html 求一个字符串的hash值: •现在我们希望找到一个hash函数,使得每一个字符串都能够映射到一个整数上 •比如hash[i]=(hash[i-1]*p+idx(s[i] 阅读全文
posted @ 2018-07-27 17:03 楼主好菜啊 阅读(281) 评论(0) 推荐(0)
摘要: Given a m-by-n (0,1)-matrix, of all its submatrices of all 1’s which is the largest? By largest we mean that the submatrix has the most elements. Inpu 阅读全文
posted @ 2018-07-26 08:43 楼主好菜啊 阅读(1127) 评论(0) 推荐(0)
摘要: 推荐博客 : https://blog.csdn.net/zuzhiang/article/details/78134247 单调栈、队列只需满足两个条件即可,序列是单调的,并且符合栈和队列的特性。 实现: 例如实现一个单调递增的栈,比如现在有一组数10,3,7,4,12。从左到右依次入栈,则如果栈 阅读全文
posted @ 2018-07-25 18:49 楼主好菜啊 阅读(209) 评论(0) 推荐(0)
摘要: 链接:https://www.nowcoder.com/acm/contest/131/D来源:牛客网 字符串 S 只包含小写英文字母。有四种操作,每次操作你可以选择其中一种: 删除字符串的第一个字母。 删除字符串的最后一个字母。 在字符串的头部添加任意一个你想要的字母。 在字符串的尾部添加任意一个 阅读全文
posted @ 2018-07-25 14:44 楼主好菜啊 阅读(177) 评论(0) 推荐(0)
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 46 下一页