自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Amazing Grace

Be the change you want to see in the world

  • 博客(12)
  • 资源 (2)
  • 收藏
  • 关注

原创 智力题-秤球

有12个球,其中有一个和其他的重量不一样,用天平称3次把这个球找出来(1)从12个中任取8个,4对4 的称,如平衡,则从剩下的4个中再任取2个,1对1的称,如再次平衡,那么从剩下的2个中任取1个和正常的一称就行了,如第2次不平衡,那么把不平衡的2个中任一个和正常的一称就可以了(2)如第一次不平衡,那么我们暂时把第一次中重的一端的称为重球,轻的一端称为轻球,现在,把2个重球和1个轻球搭配,3

2007-10-21 17:35:00 783

原创 过桥问题

问题:在漆黑的夜里,四位旅行者来到了一座狭窄而且没有护栏的桥边。如果不借助手电筒的话,大家是无论如何也不敢过桥去的。不幸的是,四个人一共只带了一只手电筒,而桥窄得只够让两个人同时过。如果各自单独过桥的话,四人所需要的时间分别是1、2、5、8分钟;而如果两人同时过桥,所需要的时间就是走得比较慢的那个人单独行动时所需的时间。问题是,如何设计一个方案,让这四人尽快过桥。更加一般性的假设N个人过桥,所

2007-09-29 14:57:00 1338

原创 平面划分

n个点最多把直线分成C(n,0)+C(n,1)份; n条直线最多把平面分成C(n,0)+C(n,1)+C(n,2)份; n个平面最多把空间分成C(n,0)+C(n,1)+C(n,2)+C(n,3)=(n³+5n+6)/6份; n个空间最多把“时空”分成C(n,0)+C(n,1)+C(n,2)+C(n,3)+C(n,4)份.

2007-09-29 14:10:00 699

原创 topcoder problem - DifDif

problem Statement/** * @(#)DifDif.java * * * @author  * @version 1.00 2007/9/6 */public class DifDif {            /**     * Creates a new instance of DifDif.     */    public DifDif() {    }    pu

2007-09-06 01:06:00 605

原创 topcoder problem - CircleCount

Problem StatementSolution by Per  @ topcoder #include sstream> #include algorithm> #include cmath> #include iostream> #include map> #include set> #include string> #include vector> using namespac

2007-09-04 23:18:00 639

原创 Topcoder problem - LetterInterchange

Problem StatementMy solution/** * @(#)LetterInterchange.java * * * @author foo bar * @version 1.00 2007/9/4 */public class LetterInterchange{    /**     * Method interchangeWhich     * @return  

2007-09-02 14:55:00 610

原创 Copy-on-write and STL string

Copy-on-write(COW) 是计算机程序设计中的一种优化策略。The fundamental idea is that if multiple callers ask for resources which are initially indistinguishable, you can give them pointers to the same resource. This fict

2007-08-09 10:11:00 682

原创 MBR, disk partitioning, .... OS

A Master Boot Record (MBR), or partition sector, is the 512-byte boot sector that is the first sector ("Sector 0") of a partitioned data storage device such as a hard disk. Due to the broad populari

2007-07-06 14:23:00 839

原创 static和const的作用

static关键字至少有下列n个作用:  (1)函数体内static变量的作用范围为该函数体,不同于auto变量,该变量的内存只被分配一次,因此其值在下次调用时仍维持上次的值;  (2)在模块内的static全局变量可以被模块内所用函数访问,但不能被模块外其它函数访问;  (3)在模块内的static函数只可被这一模块内的其它函数调用,这个函数的使用范围被限制在声明它的模块内;  (4)在类中的s

2007-07-06 11:21:00 1313 1

原创 The "right-left" rule

 The "right-left" rule is a completely regular rule for deciphering Cdeclarations. It can also be useful in creating them.First, symbols. Read * as "pointer to" - always on the left side

2007-07-06 11:18:00 1607

原创 File open mode in Ruby

Mode |  Meaning-----+--------------------------------------------------------"r" | Read-only, starts at beginning of file (default mode).-----+--------------------------------------------------------"

2007-07-06 11:15:00 1003

原创 Gotchas in the C++ programing language

Initializer listsIn C++, it is the order of the class inheritance and of the member variables that determine the initialization order, not the order of an initializer list:#include iostream>clas

2007-01-29 20:47:00 788

Microsoft Foundation Classes (MFC) Quick Reference

Microsoft Foundation Classes (MFC) Quick Reference

2007-08-14

Linux内核模块编程指南

Linux内核模块编程指南

2007-07-18

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除