码迷,mamicode.com
首页 > 其他好文
1060. Are They Equal (25)
If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0.123*105 with ...
分类:其他好文   时间:2015-12-06 12:57:30    阅读次数:223
【转】设计模式六大原则(4):接口隔离原则
定义:客户端不应该依赖它不需要的接口;一个类对另一个类的依赖应该建立在最小的接口上。问题由来:类A通过接口I依赖类B,类C通过接口I依赖类D,如果接口I对于类A和类B来说不是最小接口,则类B和类D必须去实现他们不需要的方法。解决方案:将臃肿的接口I拆分为独立的几个接口,类A和类C分别与他们需要的接口...
分类:其他好文   时间:2015-12-06 12:54:29    阅读次数:120
中国人奴性的三大特征
摘录:http://blog.sina.com.cn/s/blog_5041e2ce0100hwfx.html中华文化是一种奴性文化,这是因为二千多年来,文化发展的方向始终掌握在统治阶级手里,这种文化早已经沦落为统治阶级奴役人民精神的工具,成为麻醉人民精神的麻醉药. 奴性的文化浸泡出奴性的国民,.....
分类:其他好文   时间:2015-12-06 12:54:51    阅读次数:268
1096. Consecutive Factors (20)
n和i要用long long要不然乘着乘着就是负的了时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueAmong all the factors of a positive integer N, there may exist sev...
分类:其他好文   时间:2015-12-06 12:54:37    阅读次数:123
1068. Find More Coins (30)
动态背包题意:给定一系列的硬币值, 然后给定一个目标value, 从所有硬币中找出几个, 使得这几个硬币的和正好等于这个value, 而且这个硬币序列应该是满足硬币值字典序的最小序列.分析:属于典型的背包问题. 用动态规划(dp)做, 假设F(N, M)表示不超过面值M, 而且从前面N个硬币中挑选硬...
分类:其他好文   时间:2015-12-06 12:54:37    阅读次数:209
1085. Perfect Sequence (25)
自己想的比较好的一个算法,时间大大节省时间限制300 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CAO, PengGiven a sequence of positive integers and another positive integer p. The...
分类:其他好文   时间:2015-12-06 12:53:37    阅读次数:121
1092. To Buy or Not to Buy (20)
Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. There were many colorful strings of b...
分类:其他好文   时间:2015-12-06 12:53:54    阅读次数:161
1058. A+B in Hogwarts (20)
If you are a fan of Harry Potter, you would know the world of magic has its own currency system -- as Hagrid explained it to Harry, "Seventeen silver ...
分类:其他好文   时间:2015-12-06 12:53:16    阅读次数:143
1053. Path of Equal Weight (30)
dfs函数携带vector形参记录搜索路径时间限制10 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueGiven a non-empty tree with root R, and with weight Wi assigned to each ...
分类:其他好文   时间:2015-12-06 12:52:01    阅读次数:217
1077. Kuchiguse (20)
The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the s...
分类:其他好文   时间:2015-12-06 12:53:57    阅读次数:214
OpenGL(三)之基础绘制篇
本文将会介绍使用OpenGL进行点,线,三角形乃至多边形的绘制,,,下图是采用不同类型的图形效果一、点点”是一切的基础。 OpenGL提供了一系列函数指定一个点。它们都以glVertex开头,后面跟一个数字和1~2个字母。例如:glVertex2dglVertex2fglVertex3fglVert...
分类:其他好文   时间:2015-12-06 12:51:58    阅读次数:6092
头文件 .h 与源文件 .ccp 的区别
.h 文件一般是用来定义的,比如定义函数、类、结构体等; .cpp 文件则是对头文件的定义进行实现。 include .h文件,可以调用你声明的函数、类等。当然,比较简单的类、函数,你也可以直接在头文件里面实现。 一般来说,头文件提供接口,源文件提供实现。但是有些实现比较简单的,也可以直接写在头.....
分类:其他好文   时间:2015-12-06 12:51:47    阅读次数:3808
【转】设计模式六大原则(6):开闭原则
定义:一个软件实体如类、模块和函数应该对扩展开放,对修改关闭。问题由来:在软件的生命周期内,因为变化、升级和维护等原因需要对软件原有代码进行修改时,可能会给旧代码中引入错误,也可能会使我们不得不对整个功能进行重构,并且需要原有代码经过重新测试。解决方案:当软件需要变化时,尽量通过扩展软件实体的行为来...
分类:其他好文   时间:2015-12-06 12:52:26    阅读次数:157
直接设置UIView的x,y,width,height...
// 为UIView写分类//UIView+Extension.h#import @interface UIView (Extension)@property (nonatomic, assign) CGFloat x;@property (nonatomic, assign) CGFloat y;...
分类:其他好文   时间:2015-12-06 12:50:54    阅读次数:110
1072. Gas Station (30)
dij适合计算单源最短路径,计算一个源到各个点的距离比较快dfs不适合算每个点到每个点的距离,迭代次数太多、时间限制200 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueA gas station has to be built at such ...
分类:其他好文   时间:2015-12-06 12:51:33    阅读次数:172
1081. Rational Sum (20)
Given N rational numbers in the form "numerator/denominator", you are supposed to calculate their sum.Input Specification:Each input file contains one...
分类:其他好文   时间:2015-12-06 12:50:50    阅读次数:120
1080. Graduate Admission (30)
It is said that in 2013, there were about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Province. It would help a lot if ...
分类:其他好文   时间:2015-12-06 12:50:19    阅读次数:241
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!