Circuit Board Time Limit: 2 Seconds      Memory Limit: 65536 KB On the circuit board, there are lots of circuit paths. We know the basic constrain is that no two path cross each other, for otherwise the board will be burned. Now given a circuit diagr…
hadoop集群性能低下的常见原因 (一)硬件环境 1.CPU/内存不足,或未充分利用 2.网络原因 3.磁盘原因 (二)map任务原因 1.输入文件中小文件过多,导致多次启动和停止JVM进程.可以设置JVM重用. 2.数据倾斜:大文件且不可分割,导致处理这些文件的map需要很长时间. 3.数据本地化效果差. (三)reduce任务的原因 1.reduce任务数量过大或过小 2.数据倾斜:一部分key的记录数量太大,导致某些reduce执行过慢 3.缓慢的shuffle和排序 (四)hadoop…
Self Numbers Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 22101   Accepted: 12429 Description In 1949 the Indian mathematician D.R. Kaprekar discovered a class of numbers called self-numbers. For any positive integer n, define d(n) to…
1.  在多重循环中,如果有可能,应当将最长的循环放在最内层,最短的循环放在最外层,以减少 CPU 跨切循环层的次数. 2.  如果循环体内存在逻辑判断,并且循环次数很大,宜将逻辑判断移到循环体的外面. 3.  即使程序真的不需要default 处理,也应该保留语句 default : break. 4.  C 语言用#define 来定义常量(称为宏常量). C++ 语言除了 #define 外还可以用 const 来定义常量(称为 const 常量). 5.  const 与 #define…
B. Sagheer, the Hausmeister time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Some people leave the lights at their workplaces on when they leave that is a waste of resources. As a hausmeiste…
UIView 视图类,视图都是UIView或者UIView子类 UIWindow 窗口类,用于展示视图,视图一定要添加window才能显示 注意:一般来说,一个应用只有一个window 创建一个UIWindow对象 UIScreen 屏幕类 [UIScreen mainScreen]主屏幕 [[UIScreen mainScreen]bounds]获得主屏幕大小 如: 1.创建工程 2.把ARC改为MRC 3.window的属性由string改为retain 4.重写dealloc方法,对_wi…
1.Foundation框架中提供了很多的集合类如:NSArray,NSMutableArray,NSSet,NSMutableSet,NSDictionary,NSMutableDictionary但是这些类只能存放OC对象类型的数据 2.如果要存放基本数据类型,必须先将基本暑假类型包装成对象类型然后再用集合类进行存储,OC中提供的包装类是NSNumber,NSValue.其中NSNumber继承于NSValue. 3.NSNumber主要针对于基本数据类型的包装,NSValue主要针对结构体…
Free Kick Time Limit: 2 Seconds      Memory Limit: 65536 KB In a soccer game, a direct free kick is also awarded to the opposing team if a player commits any of the offences. A direct free kick in an immediate distance is a nightmare of the goalie. I…
4269: 买iphone Time Limit: 3 Sec  Memory Limit: 128 MB Submit: 1710  Solved: 316 Description 自从上次仓鼠中了1000万彩票后,彻底变成了土豪了,一群人愿意认他做干爹,仓鼠决定送他的干儿子每人一部iphone.仓鼠今天带了一群人去买iphone,每个人身上都背着一个大背包,只有3种背包,分别能装a,b,c个iphone,仓鼠希望每个人都能用iphone装满自己的背包.仓鼠有n个干儿子,也就是要买n部手机,仓…
转载自:http://www.cnblogs.com/liuling/p/2013-7-24-01.html 另可参考:http://gengning938.blog.163.com/blog/static/128225381201141121326346/ 排序大的分类可以分为两种:内排序和外排序.在排序过程中,全部记录存放在内存,则称为内排序,如果排序过程中需要使用外存,则称为外排序.下面讲的排序都是属于内排序. 内排序有可以分为以下几类: (1).插入排序:直接插入排序.二分法插入排序.希…