随笔分类 -  HDU

摘要:D Game Problem Description 众所周知,度度熊喜欢的字符只有两个:B 和D。今天,它发明了一个游戏:D游戏。度度熊的英文并不是很高明,所以这里的D,没什么高深的含义,只是代指等差数列[(等差数列百科)](http://baike.baidu.com/view/62268.ht 阅读全文
posted @ 2016-05-22 22:06 meekyan 阅读(685) 评论(2) 推荐(0)
摘要:1001 区间的价值: RMQ+扫描法 我们预处理RMQ求任意区间的最大值 预处理出以a[i]为最小值 能向左延伸 向右延伸的 L[i], R[i] 那么对于 一个答案 (L[i], R[i]) *rmq(L[i],R[i]) 为此长度的答案,我们可以发现他是可以更新到小于其长度的所有长度答案的,更 阅读全文
posted @ 2016-05-22 16:48 meekyan 阅读(1278) 评论(4) 推荐(0)
摘要:Sitting in Line Problem Description 度度熊是他同时代中最伟大的数学家,一切数字都要听命于他。现在,又到了度度熊和他的数字仆人们玩排排坐游戏的时候了。游戏的规则十分简单,参与游戏的N个整数将会做成一排,他们将通过不断交换自己的位置,最终达到所有相邻两数乘积的和最大的 阅读全文
posted @ 2016-05-21 20:33 meekyan 阅读(588) 评论(0) 推荐(0)
摘要:题目链接: http://bestcoder.hdu.edu.cn/contests/contest_show.php?cid=701 1001 : 矩阵快速幂 #include <iostream> #include <algorithm> #include <cstdio> #include < 阅读全文
posted @ 2016-05-21 17:51 meekyan 阅读(789) 评论(2) 推荐(3)
摘要:zxa and leaf Problem Description zxa have an unrooted tree with n nodes, including (n−1) undirected edges, whose nodes are numbered from 1 to n. The d 阅读全文
posted @ 2016-05-15 22:44 meekyan 阅读(208) 评论(0) 推荐(1)
摘要:How many integers can you find Problem Description Now you get a number N, and a M-integers set, you should find out how many integers which are small 阅读全文
posted @ 2016-05-09 21:19 meekyan 阅读(153) 评论(0) 推荐(0)
摘要:Park Visit Problem Description Claire and her little friend, ykwd, are travelling in Shevchenko's Park! The park is beautiful - but large, indeed. N f 阅读全文
posted @ 2016-05-04 22:01 meekyan 阅读(153) 评论(0) 推荐(0)
摘要:String Problem Description There is a string S.S only contain lower case English character.(10≤length(S)≤1,000,000)How many substrings there are that 阅读全文
posted @ 2016-04-22 22:23 meekyan 阅读(462) 评论(0) 推荐(0)
摘要:Caocao's Bridges Problem Description Caocao was defeated by Zhuge Liang and Zhou Yu in the battle of Chibi. But he wouldn't give up. Caocao's army sti 阅读全文
posted @ 2016-04-11 21:30 meekyan 阅读(314) 评论(0) 推荐(0)
摘要:xiaoxin and his watermelon candy Problem Description During his six grade summer vacation, xiaoxin got lots of watermelon candies from his leader when 阅读全文
posted @ 2016-03-30 13:36 meekyan 阅读(213) 评论(0) 推荐(0)
摘要:Bomber Man wants to bomb an Array. Problem Description Given an array and some positions where to plant the bombs, You have to print the Total Maximum 阅读全文
posted @ 2016-03-29 22:39 meekyan 阅读(311) 评论(0) 推荐(0)
摘要:India and China Origins Problem Description A long time ago there are no himalayas between India and China, the both cultures are frequently exchanged 阅读全文
posted @ 2016-03-28 22:30 meekyan 阅读(204) 评论(0) 推荐(0)
摘要:ZYB's Premutation Memory Limit: 131072/131072 K (Java/Others) ZYB's Premutation Memory Limit: 131072/131072 K (Java/Others) Memory Limit: 131072/13107 阅读全文
posted @ 2016-03-24 23:00 meekyan 阅读(215) 评论(0) 推荐(0)
摘要:Queue Problem Description N people numbered from 1 to N are waiting in a bank for service. They all stand in a queue, but the queue never moves. It is 阅读全文
posted @ 2016-03-24 22:41 meekyan 阅读(252) 评论(0) 推荐(0)
摘要:题意: 给定正整数n和r,定义Y数列为从正整数序列中删除所有能表示成a^b(2 ≤ b ≤ r)的数后的数列,求Y数列的第n个数是多少。 题解: 假设我们知道了cal(x)表示包括x在内的x之前这个序列有多少个数,这个要容斥 我们则二分就好了,但是不要二分,为什么呢, 没有去写二分 总之题解说了二分 阅读全文
posted @ 2016-03-15 22:13 meekyan 阅读(259) 评论(0) 推荐(0)
摘要:            题意: 给出一棵树,每个边都有一个权值,现在有一个空的集合,两种操作, 1 x吧x节点放到集合中(如果还没放入) 2 x把x节点从集合中拿出来(已放入)。 每次操作后输出最小的边权和,保证这些边可以将这些点连起来。 题解:   阅读全文
posted @ 2016-03-13 21:31 meekyan 阅读(242) 评论(0) 推荐(0)
摘要:    阅读全文
posted @ 2016-03-13 12:42 meekyan 阅读(228) 评论(0) 推荐(0)
摘要:Surround the Trees Problem Description There are a lot of trees in an area. A peasant wants to buy a rope to surround all these trees. So at first he 阅读全文
posted @ 2016-03-08 18:43 meekyan 阅读(339) 评论(1) 推荐(0)
摘要:Toposort 问题描述 给出nn个点mm条边的有向无环图. 要求删掉恰好kk条边使得字典序最小的拓扑序列尽可能小. 输入描述 输入包含多组数据. 第一行有一个整数TT, 表示测试数据组数. 对于每组数据: 第一行包含3个整数nn, mm和kk (1 \le n \le 100000, 0 \le 阅读全文
posted @ 2016-03-05 21:34 meekyan 阅读(576) 评论(2) 推荐(0)
摘要:Aragorn's Story Description Our protagonist is the handsome human prince Aragorn comes from The Lord of the Rings. One day Aragorn finds a lot of enem 阅读全文
posted @ 2016-03-05 12:10 meekyan 阅读(365) 评论(0) 推荐(0)