XNA 中的 Game 类,是所有神奇事情发生的地方。几乎游戏中所有的事情都由它来操办。 它是项目中的王者,让我们深入窥探一番: 虚方法 Game 本身从众多其它地方继续了许多能力才能完成游戏中的事情。因而它必然会重写一些方法, 以更好地完成任务。我们已经看到了一些: Initialize ,如你所...
分类:
其他好文 时间:
2014-06-28 13:55:08
阅读次数:
186
One Person GameTime Limit:1 Second Memory Limit:32768 KB Special JudgeThere is a very simple and interesting one-person game. You have 3 dice, namelyD...
分类:
其他好文 时间:
2014-06-24 10:08:41
阅读次数:
251
如果一个页面的内容呈现,需要根据url上传递的参数来进行渲染。很多时候可能是这样子写:xxx.com/xx?c=x&m=x& t=..,而我们看到的url往往是这样子的(以新浪微游戏的咖啡恋人为例) game.weibo.com/ilovecoffee….这种URL设计看上去比前一种更好一点:)如果...
分类:
Web程序 时间:
2014-06-24 09:19:23
阅读次数:
279
String slicesA segment of a string is called a slice. Selecting a slice is similar selecting a character: The operator [n:m] returns the par...
分类:
其他好文 时间:
2014-06-23 00:53:23
阅读次数:
253
Jump Game:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents y...
分类:
其他好文 时间:
2014-06-22 23:11:57
阅读次数:
310
【游戏Server中Server的类别】 There are two common and proven approaches to structuring a network game which are known asAuthoritative ServerandNon-Authoritat....
分类:
Web程序 时间:
2014-06-22 23:04:07
阅读次数:
255
设置按钮
点一下ON切换到OFF,点一下OFF切换到ON,实现:
创建菜单按钮
setimage = CCMenuItemImage::create("sound-on-A.png", "sound-off-A.png", this, menu_selector(Game::SetMusic));
setimage->setScale(0.5f);
setimage->setP...
分类:
其他好文 时间:
2014-06-22 19:38:59
阅读次数:
234
使用线段树预处理,可以使得查询RMQ时间效率在O(lgn)。
线段树是记录某范围内的最小值。
标准的线段树应用。
Geeks上只有两道线段树的题目了,而且没有讲到pushUp和pushDown操作,只是线段树的入门了。
参考:http://www.geeksforgeeks.org/segment-tree-set-1-range-minimum-query/
我修改了一下他的程序,使用...
分类:
其他好文 时间:
2014-06-22 18:08:05
阅读次数:
217
这道题也有点新意,就是需要记录最小值段和最大值段,然后成段更新这个段,而不用没点去更新,达到提高速度的目的。
本题过的人很少,因为大部分都超时了,我严格按照线段树的方法去写,一开始居然也超时。
然后修补了两个地方就过了,具体修改的地方请参看程序。
知道最大值段和最小值段,然后修补一下就能过了。不是特别难的题目。
#include
#include
#include
using na...
分类:
其他好文 时间:
2014-06-21 20:14:04
阅读次数:
230
ORACLE 11G在用EXP导出时,发现空表(没有数据或者没有用过的表)不能导出了。 查了一下资料,说是Oracle 11G中有个新特性,当表无数据时,不分配segment,以节省空间,所以这些表也没能导出来。用下面的SQL查询,发现不能导出的表, segment_created 字段值都是 .....
分类:
数据库 时间:
2014-06-20 15:49:50
阅读次数:
240