【HDOJ 4970】 Killing Monsters...
分类:
其他好文 时间:
2015-08-02 21:38:01
阅读次数:
123
题意:给一个非降序排列的整数数组a,你的任务是对于一系列询问(i, j),回答ai,ai+1...aj中次数出现最多的值所出现的次数。
思路:由于数列是非降序的,所以所有相等的数都会聚集在一起。这样我们就可以把整个数组进行编码。如-1,1,1,2,2,2,4就可以编码成(-1,1),(1,2),(2,3),(4,1)表示(a,b)数组中的a连续出现了b次。用num[i]表示原数组下表是i的数在编...
分类:
其他好文 时间:
2015-08-02 21:37:29
阅读次数:
159
该题其实是个DP,可能数据比较水,队友排序后从大的开始取都过了。。
我们来说说正解,一开始其实我已经写出来了,只是有一个地方导致了一直在输出一个不是数字的值,赛后才发现是我用memset对一个double类型的数组清-1的原因 ,改了一下就对了 。 直接开一维数组,用二进制表示集合的方法来表示哪些木棍被选取了 。 很简单的状态压缩DP 。
我用的记忆化搜索,该题还可以用三重循环地推...
分类:
其他好文 时间:
2015-08-02 21:37:14
阅读次数:
124
hdu 3338 Kakuro ExtensionDescription
If you solved problem like this, forget it.Because you need to use a completely different algorithm to solve the following one.
Kakuro puzzle is played on a grid...
分类:
其他好文 时间:
2015-08-02 21:36:14
阅读次数:
143
Given two strings s and t, write a function to determine if t is an anagram of s.
For example,
s = "anagram", t = "nagaram", return true.
s = "rat", t = "car", return false.
Note:
You may a...
分类:
其他好文 时间:
2015-08-02 21:34:46
阅读次数:
104
Description There is a piece of paper in front of Tom, its length and width are integer. Tom knows the area of this paper, he wants to know the minim....
分类:
其他好文 时间:
2015-08-02 21:35:17
阅读次数:
120
DES:给出n条线段。询问每次射中线段条数的期望。非常简单。就是每条线段的两端与原点相连的直线之间的夹角和。如果夹角大于pi。就是2pi减去这个角。最后除以总值2pi就是所求的期望。atan2(y, x)。表示指向(y, x)的射线和x轴正向组成的夹角。不知道比赛的时候是不是也能想到。#includ...
分类:
其他好文 时间:
2015-08-02 21:33:38
阅读次数:
117
在本科毕业之后,大家就觉得,我擦,JAVA好low, 我擦,J2EE好low。甚至因为我做了一段时间web开发,就叫我web狗。自然而然的,找工作打死也不知道java web开发了。于是来到了这里干起了openstack的运维和少量的开发。随着毕业季的来临,突然发现这个工作不好找,就算找到,也...
分类:
其他好文 时间:
2015-08-02 21:34:56
阅读次数:
103
有一家生产酸奶的公司,连续n周,每周需要出货numi的单位,已经知道每一周生产单位酸奶的价格ci,并且,酸奶可以提前生产,但是存储费用是一周一单位s费用,问最少的花费。对于要出货的酸奶,要不这一周生产,要不提前生产。什么时候采用什么生产方式呢?若第i周的货提前生产的话,假设在j周生产,则费用为(i-...
分类:
其他好文 时间:
2015-08-02 21:32:41
阅读次数:
127
Storm的集群结构Storm与Hadoop的架构对比 主节点 工作节点 作业Storm Numbus Supervisor toplogies(拓扑),死循环Hadoop JobTracker TaskTracker MapReduce Job,执行完成立即结...
分类:
其他好文 时间:
2015-08-02 21:31:41
阅读次数:
539
class Solution {public: string countAndSay(int n) { string res; if(n<=0) return res; res += '1'; for(int i=0;i<n-1;...
分类:
其他好文 时间:
2015-08-02 21:32:48
阅读次数:
111
水题,以至于我连题目都不想复制了。。。。因为都按最优策略,所以最后一定是把棋盘全部覆盖。哦,对了,是小明先手,题目没说。所以如果n是偶数则小明(Alice)赢,n是奇数,Bod赢。#include#includeusing namespace std;int main(){ int n; ...
分类:
其他好文 时间:
2015-08-02 21:32:20
阅读次数:
132
Description Andrewid the Android is a galaxy-famous detective. In his free time he likes to think about strings containing zeros and ones. Once he t.....
分类:
其他好文 时间:
2015-08-02 21:31:44
阅读次数:
112
DescriptionA ring is composed of n (even number) circles as shown in diagram. Put natural numbers into each circle separately, and the sum of numbers....
分类:
其他好文 时间:
2015-08-02 21:32:34
阅读次数:
154
Visual Studio2005中,新建工程 —— VC++ ——— Smart Device 中,选择任意一个工并点击ok时,New Project的对话框上了一下之后又跳出New Project的对话框,而不会出现新建工程的向导。--------------------------------...
分类:
其他好文 时间:
2015-08-02 21:29:23
阅读次数:
110
DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular...
分类:
其他好文 时间:
2015-08-02 21:31:52
阅读次数:
109
优点:Jxl对中文支持非常好,操作简单,方法看名知意。Jxl是纯javaAPI,在跨平台上表现的非常完美,代码可以再windows或者Linux上运行而无需重新编写支持Excel 95-2000的所有版本生成Excel 2000标准格式支持字体、数字、日期操作能够修饰单元格属性支持图像和图表,但是这...
分类:
其他好文 时间:
2015-08-02 21:30:02
阅读次数:
278