Arctic Network Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 19113   Accepted: 6023 Description The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication tec…
1.  在多重循环中,如果有可能,应当将最长的循环放在最内层,最短的循环放在最外层,以减少 CPU 跨切循环层的次数. 2.  如果循环体内存在逻辑判断,并且循环次数很大,宜将逻辑判断移到循环体的外面. 3.  即使程序真的不需要default 处理,也应该保留语句 default : break. 4.  C 语言用#define 来定义常量(称为宏常量). C++ 语言除了 #define 外还可以用 const 来定义常量(称为 const 常量). 5.  const 与 #define…
hadoop集群性能低下的常见原因 (一)硬件环境 1.CPU/内存不足,或未充分利用 2.网络原因 3.磁盘原因 (二)map任务原因 1.输入文件中小文件过多,导致多次启动和停止JVM进程.可以设置JVM重用. 2.数据倾斜:大文件且不可分割,导致处理这些文件的map需要很长时间. 3.数据本地化效果差. (三)reduce任务的原因 1.reduce任务数量过大或过小 2.数据倾斜:一部分key的记录数量太大,导致某些reduce执行过慢 3.缓慢的shuffle和排序 (四)hadoop…
Maya Calendar Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 70016   Accepted: 21547 Description During his last sabbatical, professor M. A. Ya made a surprising discovery about the old Maya calendar. From an old knotted message, profes…
Crashing Robots Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8340   Accepted: 3607 Description In a modernized warehouse, robots are used to fetch the goods. Careful planning is needed to ensure that the robots reach their destination…
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…
Debian6添加了insserv用来代替update-rc.d.update-rc.d 就不多做介绍. Debian6里边要添加一个自动启动的服务需要先将启动脚本放在/etc/init.d,然后使用insserv来启用这个服务. 例如服务名称为 myserver,则脚本为/etc/init.d/myserver. 然后使用 insserv myserver可以将myserver设为自动启动: </pre><pre name="code" class="py…
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主要针对结构体…