- 博客(12)
- 资源 (3)
- 收藏
- 关注
原创 Codility6 MaxCounters
Task descriptionYou are given N counters, initially set to 0, and you have two possible operations on them:increase(X) − counter X is increased by 1,max counter − all counters are set to t
2014-06-22 20:41:13
856
原创 Codility5 FrogRiverOne
Task descriptionA small frog wants to get to the other side of a river. The frog is currently located at position 0, and wants to get to position X. Leaves fall from a tree onto the surface of the
2014-06-21 23:40:34
953
原创 Codility4 PermCheck
int max = 0; for (int i = 0; i if (A[i] > max) max = A[i]; if (max != n) return 0;
2014-06-21 14:42:20
748
原创 Codility3 PermMissingElem
Task descriptionA zero-indexed array A consisting of N different integers is given. The array contains integers in the range [1..(N + 1)], which means that exactly one element is missing.Your
2014-06-20 10:33:29
887
原创 Codility2 FrogJump
FrogJumpCount minimal number of jumps from position X to Y
2014-06-19 15:36:05
1146
原创 Codility1 TapeEquilibrium
Task descriptionA non-empty zero-indexed array A consisting of N integers is given. Array A represents numbers on a tape.Any integer P, such that 0 The difference between the two parts is the
2014-06-17 23:46:39
798
原创 Effective C++ 读书笔记 【持续更新】
Chapter 1 让自己习惯C++条款01:视C++为一个语言联邦 View C++ as a federation of language.C++高效编程守则视状况而变化,取决于你使用C++的哪一部分。条款02:尽量以const,enum,inline 替换 #define Prefer consts,enums, and inlines to #de
2014-03-19 16:41:59
596
原创 2014去哪网春季校园招聘【后台开发实习生】笔试试题
趁着热乎记录下今天的题目,由于明天去北京封闭出试卷,答案尽快附上。共6题,后台开发必做三题,web的没做就不提了。1. 对于一个已经排好序的数组,查找一个随机数字,方法形如 find_num_in_sortedArray(int sortedArray, int givenValue)。 如果找到,返回响应数字下标;若未找到,则返回被查找数字本应出现的位置。 e
2014-03-08 22:54:28
1083
原创 不用加减乘除运算符计算两数之和
原文由MoreWindows撰写(http://blog.youkuaiyun.com/morewindows/article/details/8710737),这里添加另外一种实现方法。再来熟悉一下习题,这两个习题也常常在各大IT公司的笔试题面试题中出现。不用加减乘除运算符计算两个数字之和原文使用递归方式计算,但是此方法在if...else...判断中添加打印信息会导致程序输出错
2014-02-21 16:03:31
1066
转载 指向类的指针
引用:定义某个类时,它在内存中是没有被分配空间的,也就是说不存在,只有建立了实例才为这个类分配空间(是这样吧?)。是这样的,但不能说它是不存在的,类的定义是向编译器提供一个类结构说明,如果是不存在,编译器如何知道是怎样的呢...说它没有被分配空间是因为它是给编译器看的,不是给CPU看的(CPU只知道简单类型)。引用:那么,这个实例(或者说,它的类结构)在内存中是怎么被分配的?
2014-02-16 23:32:39
892
转载 WaitForSingleObject 和 WaitForMultipleObjects函数
WaitForSingleObject 和WaitForMultipleObjects:1.WaitForSingleObject 等待函数可使线程自愿进入等待状态,直到一个特定的内核对象变为已通知状态为止。这些等待函数中最常用的是WaitForSingleObject: DWORDWaitForSingleObject(HANDLE hObject, DWORD dwMillise
2014-02-07 22:07:58
590
转载 VOID和PVOID
P表示指针,那么PVOID表示:void * ---无类型指针所有指针都是一个32位二进制数(32位系统下),这个意义上说所有指针都是一样的,它们的大小一样,用于指向内存中的某处地址,然而指针为什么要有类型之分呢?答案是指针偏移。例如p为一个指针,它指向内存某处地址,那么p+1(或者写p[1])是什么意思呢?答案是p指向地址的后面那个地址,那么后面多少呢?这就看指针类型了,假如它是字符指
2014-02-07 09:11:00
640
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人