最长上升子序列,这种水题还是一眼就能看出来的。
题目大意:
主人公想在一张w*h的明信片外套信封。他有n个信封,每个信封的长宽给出,问最多能套多少层。给出从小到大的顺序。
解题思路:
最长上升子序列,只不过是记忆路径。
下面是代码:
#include
#include
#include
#include
#include
#includ...
分类:
其他好文 时间:
2014-11-29 16:07:20
阅读次数:
208
本章用来作为Starling的滤镜实现原理的一个补充,但是为了了解原理,我们会使用原生API进行编码。我们知道,当我们调用drawTriangles方法时,我们的图像是绘制到后台缓冲区的,只有调用present方法时才会把图像呈现到屏幕。我们先来看看Context3D的两个方法:setRenderT...
分类:
其他好文 时间:
2014-11-28 16:02:41
阅读次数:
206
调用web接口,get请求,发现提示:No 'Access-Control-Allow-Origin' header is present on the requested resource.这个和安全机制有关,默认不允许跨域调用处理手段:使用jsonp格式, ajax请求参数dataType:'J...
分类:
Web程序 时间:
2014-11-26 22:29:10
阅读次数:
227
在iOS5和iOS6前,View Controller的切换主要有4种:1. Push/Pop,NavigationViewController常干的事儿2. Tab,TabViewController点击3. Present Modal,调用ViewController的presentViewCo...
分类:
移动开发 时间:
2014-11-26 18:52:51
阅读次数:
460
在A域名下,用ajax请求B域名下的请求,会报类似这样的错误:No 'Access-Control-Allow-Origin' header is present on the requested resource.在响应头中加入一个属性:response.setHeader("Access-Con...
分类:
Web程序 时间:
2014-11-25 20:22:35
阅读次数:
245
我在页面编写测试list标签代码一直通过不了,总是报freemarker.template.TemplateModelException: Don't know how to present an object of this type to a template: com.evan.Person。
解决办法是:将freemarker的2.2.8jar替换成2.3.16或2.3.21(目前最新)...
分类:
其他好文 时间:
2014-11-21 14:23:24
阅读次数:
288
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2095解题思路:因为只有我们要求的那个数出现的次数为奇数,所以可以用位运算来做,两次异或同一个数最后结果不变,那么就可以知道异或运算相当于过滤掉了出现次数为偶数的数,最后只留下了唯一的那一个出现次数为奇数...
分类:
其他好文 时间:
2014-11-20 23:23:25
阅读次数:
222
1、static_cast Operator The expression static_cast ( expression ) converts expression to the type of type-id based solely on the types present in the ....
分类:
编程语言 时间:
2014-11-19 22:11:04
阅读次数:
245
've tried in a sample project to use standard, @2x and @3x images, and the iPhone 6+ simulator uses the @3x image. So it would seem that there are @3x images to be done (if the simulator actually replicates the device's behavior). But the strange thing is ...
分类:
移动开发 时间:
2014-11-19 01:53:31
阅读次数:
194
在win7系统中,利用VMwarestation创建了一个装有RHEL6.5操作系统的虚拟机,第一次使用,一切正常。可是,当win7物理机一旦重启,虚拟机就无法正常使用了(动态获取IP地址时,会报出如下错误:DerterminingIPinformationforeth0...failed-nolinkpresent,checkcable?,静态配置..
分类:
其他好文 时间:
2014-11-17 19:46:10
阅读次数:
376