11 2018 档案

摘要:题目链接:https://codeforces.com/problemset/problem/1056/E One of Arkady's friends works at a huge radio telescope. A few decades ago the telescope has sen 阅读全文
posted @ 2018-11-30 23:58 Dilthey 阅读(531) 评论(0) 推荐(0) 编辑
摘要:题目链接:传送门 关于CDQ分治(参考李煜东《算法竞赛进阶指南》): 对于一系列操作,其中的任何一个询问操作,其结果必然等价于:初始值 + 此前所有的修改操作产生的影响。 假设共有 $m$ 次操作,对于任意的满足 $1 \le l \le r \le m$ 的正整数 $l,r$,定义 $solve( 阅读全文
posted @ 2018-11-28 23:37 Dilthey 阅读(458) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3085 Problem DescriptionLast night, little erriyue had a horrible nightmare. He dreamed that he and his 阅读全文
posted @ 2018-11-27 23:37 Dilthey 阅读(210) 评论(0) 推荐(0) 编辑
摘要:链接:http://codeforces.com/contest/1032/ 是真的真的真的忍不住想吐槽这题意是真的真的真的读不懂…… A - Kitchen Utensils - [简单数学题] 题意: 国王开宴会,总共有编号为 $1 \sim 100$ 种餐具用来组成一套餐具。组成一套餐具的要求 阅读全文
posted @ 2018-11-21 23:59 Dilthey 阅读(480) 评论(0) 推荐(0) 编辑
摘要:关于配对堆的一些小姿势: 1、配对堆是一颗多叉树。 2、包含优先队列的所有功能,可用于优化Dijkstra算法。 3、属于可并堆,因此对于集合合并维护最值的问题很实用。 4、速度快于一般的堆结构(左偏树,斜堆,随机堆……),具体时间复杂度: 合并(Merge):$O(1)$; 插入(Insert/P 阅读全文
posted @ 2018-11-20 23:31 Dilthey 阅读(1842) 评论(1) 推荐(0) 编辑
摘要:题目链接:http://poj.org/problem?id=3635 题意题解等均参考:POJ 3635 - Full Tank? - [最短路变形][优先队列优化Dijkstra]。 一些口胡: 说实话,上次写类似的二维状态最短路Gym 101873C - Joyride - [最短路变形][优 阅读全文
posted @ 2018-11-20 22:42 Dilthey 阅读(536) 评论(0) 推荐(1) 编辑
摘要:题目链接:http://poj.org/problem?id=3635 Description After going through the receipts from your car trip through Europe this summer, you realised that the 阅读全文
posted @ 2018-11-20 22:02 Dilthey 阅读(527) 评论(0) 推荐(0) 编辑
摘要:题目链接:传送门 描述 Ha'nyu是来自异世界的魔女,她在漫无目的地四处漂流的时候,遇到了善良的少女Rika,从而被收留在地球上。Rika的家里有一辆飞行车。有一天飞行车的电路板突然出现了故障,导致无法启动。电路板的整体结构是一个R行C列的网格(R,C≤500),如右图所示。每个格点都是电线的接点 阅读全文
posted @ 2018-11-20 20:12 Dilthey 阅读(723) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3183 Problem DescriptionKiki likes traveling. One day she finds a magic lamp, unfortunately the genie i 阅读全文
posted @ 2018-11-20 17:03 Dilthey 阅读(331) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://poj.org/problem?id=2408 World-renowned Prof. A. N. Agram's current research deals with large anagram groups. He has just found a new appli 阅读全文
posted @ 2018-11-19 23:26 Dilthey 阅读(560) 评论(0) 推荐(0) 编辑
摘要:最近这段时间感冒外加一些乱七八糟的事情,导致脑子严重僵化……只好刷刷基础(水)题巩固巩固基础(混混题数)。 目录 P1003 铺地毯 P1067 多项式输出 P1540 机器翻译 P1056 排座椅 P1328 生活大爆炸版石头剪刀布 P1563 玩具谜题 P1003 铺地毯 P1067 多项式输出 阅读全文
posted @ 2018-11-19 21:54 Dilthey 阅读(290) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://codeforces.com/gym/101981/attachments 题意: 令 $mul(l,r) = \prod_{i=l}^{r}a_i$,且 $fac(l,r)$ 代表 $mul(l,r)$ 的不同素因子个数。求 $\sum_{i=1}^{n}\sum_{j=i 阅读全文
posted @ 2018-11-19 21:11 Dilthey 阅读(1284) 评论(0) 推荐(1) 编辑
摘要:题目链接:http://codeforces.com/gym/101981/attachments The use of the triangle in the New Age practices seems to be very important as it represents the unh 阅读全文
posted @ 2018-11-19 16:31 Dilthey 阅读(600) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://codeforces.com/gym/101981/attachments There are n heroes and m monsters living in an island. The monsters became very vicious these days,s 阅读全文
posted @ 2018-11-18 21:43 Dilthey 阅读(892) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://codeforces.com/gym/101981/problem/K Your friend has made a computer video game called “Kangaroo Puzzle” and wants you to give it a try for 阅读全文
posted @ 2018-11-18 20:58 Dilthey 阅读(921) 评论(0) 推荐(0) 编辑
摘要:链接:http://codeforces.com/contest/1062 A - Prank - [二分] 题意: 给出长度为 $n(1 \le n \le 100)$ 的数组 $a[1 \sim n]$,且满足 $1 \le a[1] < a[2] < \cdots < a[n] \le 100 阅读全文
posted @ 2018-11-17 17:22 Dilthey 阅读(403) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1247 Problem DescriptionA hat’s word is a word in the dictionary that is the concatenation of exactly t 阅读全文
posted @ 2018-11-17 15:32 Dilthey 阅读(199) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5954 Problem DescriptionYou have got a cylindrical cup. Its bottom diameter is 2 units and its height i 阅读全文
posted @ 2018-11-17 12:58 Dilthey 阅读(420) 评论(0) 推荐(0) 编辑
摘要:题目链接: http://poj.org/problem?id=1816 http://bailian.openjudge.cn/practice/1816?lang=en_US Time Limit: 2000MS Memory Limit: 65536K Description A word i 阅读全文
posted @ 2018-11-17 11:45 Dilthey 阅读(436) 评论(0) 推荐(0) 编辑
摘要:题目链接: http://poj.org/problem?id=2513 http://bailian.openjudge.cn/practice/2513?lang=en_US Time Limit: 5000MS Memory Limit: 128000K Description You are 阅读全文
posted @ 2018-11-16 18:38 Dilthey 阅读(340) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://poj.org/problem?id=3630 Given a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. 阅读全文
posted @ 2018-11-16 13:11 Dilthey 阅读(320) 评论(0) 推荐(0) 编辑
摘要:0101 a^b 题目链接:传送门 描述 求 a 的 b 次方对 p 取模的值,其中 1≤a,b,p≤10^9 输入格式 三个用空格隔开的整数 a,b 和 p。 输出格式 一个整数,表示 a^b mod p 的值。 样例输入 2 3 9 样例输出 8 题解: 快速幂。 AC代码: 0102 64位整 阅读全文
posted @ 2018-11-14 15:18 Dilthey 阅读(375) 评论(0) 推荐(0) 编辑
摘要:题目链接:传送门 描述石头游戏在一个 $n$ 行 $m$ 列 ($1 \le n,m \le 8$) 的网格上进行,每个格子对应一种操作序列,操作序列至多有 $10$ 种,分别用 $0 \sim 9$ 这 $10$ 个数字指明。操作序列是一个长度不超过 $6$ 且循环执行、每秒执行一个字符的字符串。 阅读全文
posted @ 2018-11-13 21:09 Dilthey 阅读(546) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://codeforces.com/contest/483 A - Counterexample - [简单构造题] Your friend has recently learned about coprime numbers. A pair of numbers $(a, b)$ 阅读全文
posted @ 2018-11-13 13:29 Dilthey 阅读(276) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=4062 题意: 现在在一条 $x$ 轴上玩植物大战僵尸,有 $n$ 个植物,编号为 $1 \sim n$,第 $i$ 个植物的位置在坐标 $i$,成长值为 $a_i$ 阅读全文
posted @ 2018-11-12 23:36 Dilthey 阅读(398) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=4063 Input Output Sample Input Sample Output 题意: 说现在有 $n$ 个人打比赛,要你安排 $k$ 轮比赛,要求每轮每个人 阅读全文
posted @ 2018-11-12 22:12 Dilthey 阅读(529) 评论(0) 推荐(0) 编辑
摘要:链接:传送门 A - Thickest Burger - [签到水题] ACM ICPC is launching a thick burger. The thickness (or the height) of a piece of club steak is A (1 ≤ A ≤ 100). T 阅读全文
posted @ 2018-11-12 12:49 Dilthey 阅读(189) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5950 Farmer John likes to play mathematics games with his N cows. Recently, they are attracted by recur 阅读全文
posted @ 2018-11-12 12:00 Dilthey 阅读(260) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=4067 题意: 给出 $n$ 本书(编号 $1 \sim n$),第 $i$ 本书的价格为 $a_i$ 元。我现在手上有若干元钱,我买书的策略为从 $1 \sim n 阅读全文
posted @ 2018-11-10 23:05 Dilthey 阅读(297) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=4060 题意: 给出两个 $0,1$ 字符串 $S,T$,现在你有两次对 $S$ 作区间翻转($0 \rightarrow 1,1 \rightarrow 0$)的操 阅读全文
posted @ 2018-11-10 22:47 Dilthey 阅读(535) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5840 Time Limit: 1 Second Memory Limit: 65536 KB If we define $f(0)=1,f(1)=0,f( 阅读全文
posted @ 2018-11-10 22:08 Dilthey 阅读(430) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://bailian.openjudge.cn/practice/1451/ 总时间限制: 1000ms 内存限制: 65536kB 描述 Background A while ago it was quite cumbersome to create a message for 阅读全文
posted @ 2018-11-09 23:16 Dilthey 阅读(549) 评论(0) 推荐(0) 编辑
摘要:题目链接:https://cn.vjudge.net/problem/LightOJ-1224 Given a set of $n$ DNA samples, where each sample is a string containing characters from {A, C, G, T}, 阅读全文
posted @ 2018-11-09 21:51 Dilthey 阅读(436) 评论(0) 推荐(0) 编辑
摘要:题目链接: http://poj.org/problem?id=2001 http://bailian.openjudge.cn/practice/2001 总时间限制: 1000ms 内存限制: 65536kB A prefix of a string is a substring startin 阅读全文
posted @ 2018-11-09 17:41 Dilthey 阅读(338) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2072 Problem Descriptionlily的好朋友xiaoou333最近很空,他想了一件没有什么意义的事情,就是统计一篇文章里不同单词的总数。下面你的任务是帮助xiaoou333解决这个问题。 阅读全文
posted @ 2018-11-09 16:32 Dilthey 阅读(361) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://poj.org/problem?id=3764 Time Limit: 2000MS Memory Limit: 65536K Description In an edge-weighted tree, the xor-length of a path p is define 阅读全文
posted @ 2018-11-08 23:40 Dilthey 阅读(310) 评论(0) 推荐(0) 编辑
摘要:题目链接:传送门 描述在给定的 $N$ 个整数 $A_1, A_2,\cdots,A_N$ 中选出两个进行xor运算,得到的结果最大是多少? 输入格式第一行一个整数 $N$,第二行 $N$ 个整数 $A_1, A_2,\cdots,A_N$。 输出格式一个整数表示答案。 样例输入31 2 3 样例输 阅读全文
posted @ 2018-11-08 22:08 Dilthey 阅读(389) 评论(0) 推荐(0) 编辑
摘要:题目链接:传送门 描述给定 $N$ 个字符串 $S_1,S_2,\cdots,S_N$,接下来进行 $M$ 次询问,每次询问给定一个字符串 $T$,求 $S_1 \sim S_N$ 中有多少个字符串是 $T$ 的前缀。输入字符串的总长度不超过 $10^6$,仅包含小写字母。 输入格式第一行两个整数 阅读全文
posted @ 2018-11-08 21:17 Dilthey 阅读(402) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://codeforces.com/gym/101873/problem/K 题意: 现在给出 $n(1 \le n \le 1e4)$ 个员工,最多可以裁员 $k$ 人,名字为 $s_i$ 的员工的薪资为 $c_i(1 \le c_i \le 1e5)$。 已知必须节省下 $d( 阅读全文
posted @ 2018-11-08 20:10 Dilthey 阅读(248) 评论(0) 推荐(0) 编辑
摘要:题目链接:传送门 描述输入一个长度为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 阅读(467) 评论(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 阅读(433) 评论(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 阅读(983) 评论(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 阅读(761) 评论(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) 编辑