09 2014 档案

摘要:创新工场笔试:单选和编程题目单选不怎么记得了,有几道比较难,这里记录一下1)10个左右括号组成满足条件的方案数,这个典型的catalan数,也是一个X>=Y的组合问题,可以看一下组合相关知识求解;2)K(M,N) 一个递推推导,我是推导一部分,然后找规律(好像是K(2,m)= 2*m+3)if M ... 阅读全文
posted @ 2014-09-26 21:37 purejade 阅读(278) 评论(0) 推荐(0)
摘要:一开始一直无法理解STL中的内存分析,一天很困,翻开了侯捷的STL源码解析,阅读一二,这是一针见血,字字珠玑,解开了一个又一个迷惑~简单记录,和大家分享一下1) 空间适配器template inline void _construct(T1 *p,const T2 &value) { new (p... 阅读全文
posted @ 2014-09-20 22:49 purejade 阅读(179) 评论(0) 推荐(0)
摘要:C++中处理split的函数,首先要了解几个函数C++中string自己带的find_first_of 或者find_first_not_offind_last_of 或者find_last_not_of函数原型为:可以用来超找字符串,char,char *三种类型string (1)size_t ... 阅读全文
posted @ 2014-09-14 13:05 purejade 阅读(1192) 评论(0) 推荐(0)
摘要:print all unique solution to split number n, given choice of 1 3 5 10for example if n is 4{1, 1, 1, 1}{1, 3}思路:用DFS肯定可以求解,但需要遍历所有可能,进行剪纸之后用递推实现。主要剪枝思想... 阅读全文
posted @ 2014-09-10 18:19 purejade 阅读(136) 评论(0) 推荐(0)
摘要:笔试题目:1、#include using namespace std;char * getMemory() { char p[] = "hello world";//字符串常量 return p;}int main(){char *str=NULL;str = getMemory();coutus... 阅读全文
posted @ 2014-09-09 23:38 purejade 阅读(306) 评论(0) 推荐(0)
摘要:c+11新增加了一些便利的算法,这些新增的算法使我们的代码写起来更简洁方便,这里仅仅列举一些常用的新增算法,算是做个总结,更多的新增算法读者可以参考http://en.cppreference.com/w/cpp/algorithm。 算法库新增了三个用于判断的算法all_of、any_of和... 阅读全文
posted @ 2014-09-07 21:12 purejade 阅读(254) 评论(0) 推荐(0)
摘要:常见错误:' '.join(list): it need to guarantee the element of list is string, so it it better it strlist = ''.join(str(v) for v in list)str.split(" ") just... 阅读全文
posted @ 2014-09-05 16:52 purejade 阅读(160) 评论(0) 推荐(0)