摘要: Description Given a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1*1 or greater ... 阅读全文
posted @ 2016-04-03 17:53 _Mickey 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 今天,关于素数问题纠结了好久好久,倍感知识缺乏啊。因此,通过自己的了解和网上查阅资料,加上自己的啰嗦,在这里整理一下,日后可以翻阅。 首先,感谢网上的前辈,如果没有您们,我不会获得关于素数的比较全面的知识。非常感谢。 1、素数及相关 素数,又称质数,在一个大于... 阅读全文
posted @ 2016-04-03 17:49 _Mickey 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 小邪酷爱吃橘子,但他的橘子总是被同学们“打劫”。虽然小邪很大方,喜欢和同学们分享他的橘子,但如果和他分享的人太多,他自己就没有橘子吃啦!所以小邪希望找到一个和同学们分享橘子的方案。假设小邪一共有N个橘子,他自己希望至少保留M个给自己吃。小邪一共有K个同学,友好程度可以用一个正整数表示,数值越大... 阅读全文
posted @ 2016-04-03 14:17 _Mickey 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Description Bessie is planning her day of munching tender spring grass and is gazingout upon the pasture which Farmer John has so lovingly parti... 阅读全文
posted @ 2016-04-03 14:15 _Mickey 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Description 2020年,xx开了一家拥有N个员工的大公司。每天,xx都要分配N项工作给他的员工,但是,由于能力的不同,每个人对处理相同工作所需要的时间有快有慢。众所周知,xx是一个非常重视效率的人,他想知道该如何分配工作,才能使得完成所有工作的时间总和最小(每个员工只可以被分... 阅读全文
posted @ 2016-04-03 14:13 _Mickey 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Description I Moo被M国政府聘请做经济规划专家,现在M国马上给了I Moo新任务:在华尔街有N家公司,现在面对经济危机不得不进行公司合并,使这些公司合并成一个大公司从而存活下来。现在政府将这N家公司上一季度的盈利率告诉I Moo,并且规定合并后的公司盈利率为上季度各公司盈... 阅读全文
posted @ 2016-04-03 14:12 _Mickey 阅读(207) 评论(0) 推荐(0) 编辑
摘要: Description 有 N 堆纸牌,编号分别为 1,2,…, N。每堆上有若干张,但纸牌总数必为 N 的倍数。可以在任一堆上取若于张纸牌,然后移动。 移牌规则为:在编号为 1 堆上取的纸牌,只能移到编号为 2 的堆上;在编号为 N 的堆上取的纸牌,只能移到编号为 N-1 的堆上;其... 阅读全文
posted @ 2016-04-03 14:10 _Mickey 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 题意:求一个排列的逆序数。 #include#include#includeconst int maxn=1000005;int maze[maxn],temp[maxn];long long ans;void union_set(int l,int mid,int r){ int i=... 阅读全文
posted @ 2016-04-03 14:09 _Mickey 阅读(221) 评论(0) 推荐(0) 编辑
摘要: Description Farmer John has 2^N (1 #include#includeconst int maxn=1025;int a[maxn],b[maxn];int ans,k;void a_array(int a[],int begin,int mid,int ... 阅读全文
posted @ 2016-04-03 14:07 _Mickey 阅读(162) 评论(0) 推荐(0) 编辑
摘要: We define B is a Divisor of one number A if A is divisible by B. So, the divisors of 12 are 1, 2, 3, 4, 6, 12. So, 12 has 6 divisors in tota... 阅读全文
posted @ 2016-04-03 14:03 _Mickey 阅读(127) 评论(0) 推荐(0) 编辑