上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 45 下一页
摘要: next_permutation 是一个定义在 <algorithm> 中的一个全排列函数, 用于按顺序生成一个数列的全排列 基本用法 : 阅读全文
posted @ 2018-07-30 15:25 楼主好菜啊 阅读(157) 评论(0) 推荐(0) 编辑
摘要: int read() { //输入挂 int x = 0, f = 1; register char ch = getchar(); while (ch'9') { if (ch == '-')f = -1; ch = getchar(); } while (ch >= '0'&&ch <= '9') { x = x * 10 + c... 阅读全文
posted @ 2018-07-30 10:41 楼主好菜啊 阅读(188) 评论(1) 推荐(1) 编辑
摘要: 链接: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 楼主好菜啊 阅读(1734) 评论(0) 推荐(0) 编辑
摘要: 链接:https://www.nowcoder.com/acm/contest/131/B来源:牛客网 题目描述 矩阵 M 包含 R 行 C 列,第 i 行第 j 列的值为 Mi,j。 请寻找一个子矩阵,使得这个子矩阵的和最大,且满足以下三个条件: 子矩阵的行数不能超过 X 行。 子矩阵的列数不能超 阅读全文
posted @ 2018-07-29 00:02 楼主好菜啊 阅读(229) 评论(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 楼主好菜啊 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 哈利波特在魔法学校的必修课之一就是学习魔咒。据说魔法世界有100000种不同的魔咒,哈利很难全部记住,但是为了对抗强敌,他必须在危急时刻能够调用任何一个需要的魔咒,所以他需要你的帮助。 给你一部魔咒词典。当哈利听到一个魔咒时,你的程序必须告诉他那个魔咒的功能;当哈利需要某个功能但不知道该用什么魔咒时 阅读全文
posted @ 2018-07-28 08:45 楼主好菜啊 阅读(451) 评论(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 楼主好菜啊 阅读(163) 评论(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 楼主好菜啊 阅读(496) 评论(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 楼主好菜啊 阅读(250) 评论(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 楼主好菜啊 阅读(1080) 评论(0) 推荐(0) 编辑
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 45 下一页