上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 22 下一页
摘要: 题目链接:传送门 描述输入一个长度为n的整数序列,从中找出一段不超过m的连续子序列,使得整个序列的和最大。 例如 $1,-3,5,1,-2,3$。 当 $m=4$ 时,$S=5+1-2+3=7$;当 $m=2$ 或 $m=3$ 时,$S=5+1=6$。 输入格式第一行两个数 $n,m(n,m \le 阅读全文
posted @ 2018-11-08 15:58 Dilthey 阅读(703) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/gym/101873/problem/C 题意: 这是七月的又一个阳光灿烂的日子,你决定和你的小女儿一起度过快乐的一天。因为她真的很喜欢隔壁镇上的仙女公园,所以你决定到那儿去玩一天。 你妻子同意开车送你去公园接你。她非常准时,所以她确切地告诉你她 阅读全文
posted @ 2018-11-08 15:19 Dilthey 阅读(644) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://leetcode-cn.com/problems/divide-two-integers/description/ 给定两个整数,被除数 dividend 和除数 divisor。将两数相除,要求不使用乘法、除法和 mod 运算符。 返回被除数 dividend 除以除数 阅读全文
posted @ 2018-11-08 12:41 Dilthey 阅读(371) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.lydsy.com/JudgeOnline/problem.php?id=2457 Description Sherry现在碰到了一个棘手的问题,有N个整数需要排序。 Sherry手头能用的工具就是若干个双端队列。她需要依次处理这N个数,对于每个数,Sherry能做 阅读全文
posted @ 2018-11-06 22:57 Dilthey 阅读(543) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/gym/101873/problem/D 题意: 给出 $n$ 个事实,表述为 "XXX are worse than YYY"。再给出 $m$ 个某人说的话,也是表述为 "XXX are worse than YYY",对于每句话都要判断是否正 阅读全文
posted @ 2018-11-05 21:58 Dilthey 阅读(434) 评论(0) 推荐(0) 编辑
摘要: 链接:http://codeforces.com/contest/1043 A - Elections - [水水水水题] 题意: 我和另一个人竞争选举,共有 $n$ 个人投票,每个人手上有 $k$ 票,必须投给我或者另一个人。 现在已知每个人给另一个人投 $a_i$ 票,也就是说会给我投 $k-a 阅读全文
posted @ 2018-11-05 20:30 Dilthey 阅读(468) 评论(0) 推荐(0) 编辑
摘要: 题目链接: http://codeforces.com/gym/101194/attachments https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&prob 阅读全文
posted @ 2018-11-05 14:00 Dilthey 阅读(535) 评论(0) 推荐(0) 编辑
摘要: 题目链接: http://codeforces.com/gym/101194/attachments https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&prob 阅读全文
posted @ 2018-11-04 21:47 Dilthey 阅读(339) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=2259 Queues and Priority Queues are data structures which are known to most computer scientists. The Team Queue, howeve 阅读全文
posted @ 2018-11-04 20:46 Dilthey 阅读(434) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=2559 题意: 给出 $n(1 \le n \le 10^5)$ 个宽为 $1$,高为 $h_i(0 \le h_i \le 10^9)$ 的矩形,它们从原点开始并排在 $x$ 轴上, 现在要求出,这个合并产生的图形内部最大的矩形的面积 阅读全文
posted @ 2018-11-04 19:50 Dilthey 阅读(441) 评论(0) 推荐(0) 编辑
摘要: 题目链接: http://codeforces.com/gym/101194/attachments https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&prob 阅读全文
posted @ 2018-11-04 15:22 Dilthey 阅读(277) 评论(0) 推荐(0) 编辑
摘要: 题目链接: http://codeforces.com/gym/101194/attachments https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&prob 阅读全文
posted @ 2018-11-04 14:18 Dilthey 阅读(309) 评论(0) 推荐(0) 编辑
摘要: (参考:李煜东《算法竞赛进阶指南》:0x04 二分) 我们都知道,实数域上的二分的写法非常简单,确定好精度很省心。 而整数集上的二分,是需要关注起始边界、终止边界、中点选择、左右区间取舍时的开闭情况的。 《算法竞赛进阶指南》上的整数集合上二分写法和我平时喜欢使用的是一样的,因此进行记录,以便后续参考 阅读全文
posted @ 2018-11-04 13:19 Dilthey 阅读(987) 评论(0) 推荐(0) 编辑
摘要: 1.债务记录:0 (注:欠债为负,盈余为正) 已退役。 2019年3月记录: 2019-3-20:+0 = -30 2019-3-19:+0 = -30 2019-3-18:+3 = -30 2019-3-17:-3 = -33 2019-3-16:+2 = -30 2019-3-15:+0 = - 阅读全文
posted @ 2018-11-03 23:50 Dilthey 阅读(1020) 评论(3) 推荐(1) 编辑
摘要: 题目链接: http://codeforces.com/gym/101194/attachments https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&prob 阅读全文
posted @ 2018-11-03 23:14 Dilthey 阅读(762) 评论(0) 推荐(0) 编辑
摘要: 题目链接: http://codeforces.com/gym/101194/attachments https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&prob 阅读全文
posted @ 2018-11-03 20:15 Dilthey 阅读(273) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5542 Problem DescriptionCao Cao made up a big army and was going to invade the whole South China. Yu Zh 阅读全文
posted @ 2018-11-02 21:44 Dilthey 阅读(377) 评论(1) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4699 Problem Description Sample Input8I 2I -1I 1Q 3LDRQ 2 Sample Output23 Hint 题意: 维护一个整数序列的编辑器,有以下五种操作 阅读全文
posted @ 2018-11-02 16:10 Dilthey 阅读(313) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://leetcode-cn.com/problems/min-stack/description/ 设计一个支持 push,pop,top 操作,并能在常数时间内检索到最小元素的栈。 push(x) -- 将元素 x 推入栈中。pop() -- 删除栈顶的元素。top() -- 阅读全文
posted @ 2018-11-02 15:11 Dilthey 阅读(346) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/gym/101873/problem/I 题意: 给出 $n(1 \le n \le 300000)$ 个单位时间,每个单位时间给出一个 $x_i(0 \le x_i \le 32)$ 代表该单位时间内视野内的敌人数目。 现在你有一个终极武器,每 阅读全文
posted @ 2018-11-02 14:02 Dilthey 阅读(365) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1241 题意: 求某块平面上,连通块的数量。一个油田格子若周围八个方向也有一个油田格子,则认为两者相连通。 AC代码: 阅读全文
posted @ 2018-10-31 16:44 Dilthey 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=3984 Description 定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0 阅读全文
posted @ 2018-10-31 15:40 Dilthey 阅读(437) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://cn.vjudge.net/problem/UVA-11624 题意: 给出一个 $n \times m$ 的矩阵,上面有的格子能走,有的格子是墙不能走。 有若干个点是火源,火每分钟都往上下左右蔓延一格(不能越墙)。又给出一个点是Joe的出发点,他只要能在不碰到火的前提下走 阅读全文
posted @ 2018-10-31 00:24 Dilthey 阅读(338) 评论(0) 推荐(0) 编辑
摘要: Fat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid of this board is con 阅读全文
posted @ 2018-10-30 22:26 Dilthey 阅读(2208) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/gym/101873/problem/G 题意: 在点阵上,给出 $N$ 个点的坐标(全部都是在格点上),将它们按顺序连接可以构成一个多边形,求该多边形内包含的格点的数目。 题解: 首先,根据皮克定理 $S = a + \frac{b}{2} - 阅读全文
posted @ 2018-10-29 23:26 Dilthey 阅读(773) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 22 下一页