设计模式之——单例模式。(希望对你有所帮助,谢谢。)...
分类:
其他好文 时间:
2014-11-11 22:56:03
阅读次数:
194
题目大意:有一个书架,现在需要经常改变这些书的位置,每次询问一本书在哪或者第几本书是什么。
思路:赤裸裸的Splay,只是有些小事需要注意。因为他有的时候问你一个书在哪,这个事情不能只在Splay中就能解决,我们需要辅助他解决。注意到操作中没有加入书的操作,也就是书的总数并不会变化,而且Splay的过程中只是指针的变动,所以不会有点发生变化,所以在一开始建树的时候维护一个数组,表示这本书...
分类:
其他好文 时间:
2014-11-11 22:54:52
阅读次数:
241
Description
The SUM problem can be formulated as follows: given four lists
A, B, C, D of integer values, compute how many quadruplet
(a, b, c, d ) AxBxCxD
are such that a + b + c + d = 0 . In...
分类:
其他好文 时间:
2014-11-11 22:55:20
阅读次数:
173
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link...
分类:
其他好文 时间:
2014-11-11 22:56:05
阅读次数:
218
http://poj.org/problem?id=2393
题意:任务规定,一个酸奶制造厂,在n个星期内,分别要向外提供y[i]unit的酸奶。已知这个制造厂第i周制造每unit酸奶的费用为c[i],储存室储存每1unit酸奶1星期的费用为s。问要完成这个任务的最小费用是多少。
.
.
.
.
.
.
.
.
.
.
.
.
.
思路:简单贪心。维护一个目前最优的代...
分类:
其他好文 时间:
2014-11-11 22:55:16
阅读次数:
297
Reverse digits of an integer.
Example1: x = 123, return 321
Example2: x = -123, return -321
class Solution {
public:
int reverse(int x) {
int Answer=0;
...
分类:
其他好文 时间:
2014-11-11 22:53:55
阅读次数:
203
以下内容都是全英文的,对githu的使用作了详细的介绍。都是比较简单地词汇,阅读后相信你会对github的工作方式,基本操作很了解了。当然,有可能看完后你会跟我一样觉得,还不如git --help命令来得直接。
Git is a distributed version control system
To initialize a Git repository in current dire...
分类:
其他好文 时间:
2014-11-11 22:53:34
阅读次数:
253
最近手游开发很热,今天我们来看看目前比较主流的手机游戏开发技术,以下仅仅是个人了解的皮毛,为想了解和步入游戏行业的朋友做一参考。cocos2d我们先来看一幅图:要看懂这幅图就先要了解一下cocos2d的生命历程,下面我来做一下简要的归纳和介绍吧。2005年,Ricardo和朋友萌生了用Python语言 “一星期编写一个游戏”的想法。在2005~2007年间,他们设计了许多种这样的游戏。值得注意的是...
分类:
其他好文 时间:
2014-11-11 22:52:44
阅读次数:
361
http://poj.org/problem?id=1017
1.题意:
一个工厂制造的产品形状都是长方体盒子,它们的高度都是 h,长和宽都相等,一共有六个型号,分别为1*1, 2*2, 3*3, 4*4, 5*5, 6*6。
这些产品通常使用一个 6*6*h 的长方体箱子包装然后邮寄给客户。因为邮费很贵,所以工厂要想方设法的减小每个订单运送时的箱子数量BoxNum。
...
分类:
其他好文 时间:
2014-11-11 22:51:12
阅读次数:
190
HDU 4782 Beautiful Soup(模拟)...
分类:
其他好文 时间:
2014-11-11 22:52:09
阅读次数:
292
Given n non-negative
integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.
Above is a histogram where wid...
分类:
其他好文 时间:
2014-11-11 22:52:05
阅读次数:
247
题目链接:poj 1699 Best Sequence
题目大意;给定N个DNA序列,问说最少多长的字符串包含所有序列。
解题思路:AC自动机+状压DP,先对字符串构造AC自动机,然后在dp[s][i]表示匹配了s,移动到节点i时候的最短步数。
#include
#include
#include
#include
#include
#include
using nam...
分类:
其他好文 时间:
2014-11-11 22:52:22
阅读次数:
288
Problem Description
Tom has a necklace with n jewels. There is a number on each jewel. Now Tom wants to select a wonderful chain from the necklace. A chain will be regarded wonderful if the wonderf...
分类:
其他好文 时间:
2014-11-11 22:49:33
阅读次数:
244
南阳OJ 16 矩形嵌套 DAG上的动规基础题...
分类:
其他好文 时间:
2014-11-11 22:50:23
阅读次数:
157
Language:
Default
Rails
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 25336
Accepted: 9953
Description
There is a famous railway station in PopPush C...
分类:
其他好文 时间:
2014-11-11 22:51:08
阅读次数:
213
FeTestAndCov,简单易用的前端dom单元测试框架,主要功能为前端单元测试和代码覆盖率统计。...
分类:
其他好文 时间:
2014-11-11 22:51:19
阅读次数:
258