摘要: 题意:Suppose there are the symbols M, I, and U which can be combined to produce strings of symbols called "words". We start with one word MI, and transf... 阅读全文
posted @ 2015-07-04 23:27 miao_a_miao 阅读(709) 评论(0) 推荐(0) 编辑
摘要: 题意:说在遥远的地方有一个非常富裕的村落,有一天,村长决定进行制度改革:重新分配房子。这可是一件大事,关系到人民的住房问题啊。村里共有n间房间,刚好有n家老百姓,考虑到每家都要有房住(如果有老百姓没房子住的话,容易引起不安定因素),每家必须分配到一间房子且只能得到一间房子。另一方面,村长和另外的村领... 阅读全文
posted @ 2015-07-04 22:57 miao_a_miao 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 题目大意:给出一个N*N矩形,每个格子上有一个价值。询问一个b*b的矩形在左上角的位置(x,y),(x+b-1,y+b-1)这一部分的最大值-最小值是多少。模板题 1 #include 2 #include 3 #include 4 #include 5 using namespace st... 阅读全文
posted @ 2015-07-04 16:41 miao_a_miao 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 题意:给出n个数和Q个询问(l,r),对于每个询问求出(l,r)之间连续出现次数最多的次数。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 #... 阅读全文
posted @ 2015-07-04 11:22 miao_a_miao 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 十分烦躁 阅读全文
posted @ 2015-07-04 10:49 miao_a_miao 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 题意:Given you a sequence of number a1, a2, ..., an.They are also a permutation of 1...n. You need to answer some queries,each with the following for... 阅读全文
posted @ 2015-07-04 10:47 miao_a_miao 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 题目大意:有一个数列 x1..xn,要求一个数x使得 sigma(abs(xi-x))值最小,很明显,对数列进行排序后最中间的那个数就是x,可用划分树求得,那么如何求和呢,经过计算可知,既然x 是最中间的那个数,那么最后的和 即为 x左边 xmid-x1+xmid-x2.. + x(mid+1) -... 阅读全文
posted @ 2015-07-04 00:06 miao_a_miao 阅读(145) 评论(0) 推荐(0) 编辑