Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any positive intege...
分类:
移动开发 时间:
2015-10-16 09:58:03
阅读次数:
240
LeetCode -- Happy Number...
分类:
移动开发 时间:
2015-10-14 01:37:39
阅读次数:
120
Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer...
分类:
移动开发 时间:
2015-10-07 17:35:41
阅读次数:
194
容易想到dp[i][j]表示在第i行j个路口的开始走最大高兴值。每次可以向左走,或者向右边走,然后向北走。(或者直接往北)向左走到,状态转移为dp[i][j] = dp[i][k] + happy[i][k][j]处理出前缀和,happy[i][k][j]表示为sum[i][j] - sum[i][...
分类:
其他好文 时间:
2015-10-05 23:29:07
阅读次数:
225
www.itwhy.org/linux/debian7-%E5%AE%89%E8%A3%85-kvm-%E8%99%9A%E6%8B%9F%E6%9C%BA.htmlwww.storageonline.com.cn/life_work/happy-work/use-virt-install-to-c...
分类:
其他好文 时间:
2015-09-30 11:05:39
阅读次数:
302
/*题目要求: 替换空格。 we are happy。 we%20are%20happy。算法解析: 字符串长度为14. 先计算有多少个空格,测试字符串为2个。这样总长度为18. 从最后一个字符向后移动,注意控制指针,空格是1个字符,%20是三个。*/#inclu...
分类:
其他好文 时间:
2015-09-27 20:01:14
阅读次数:
139
替换空格参与人数:5033时间限制:1秒空间限制:32768K通过比例:16.93%最佳记录:0 ms|0K(来自codeinniu)题目描述请实现一个函数,将一个字符串中的空格替换成“%20”。例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。提交...
分类:
其他好文 时间:
2015-09-25 21:46:48
阅读次数:
213
The Cats' Feeding Spots时间限制:1000ms单点时限:1000ms内存限制:256MB描述In Yan Yuan, the Peking University campus, there are many homeless cats. They all live happy ...
分类:
其他好文 时间:
2015-09-23 10:22:39
阅读次数:
193
题意:给定n个数,从中分别取出0个,1个,2个...n个,并把他们异或起来,求大于m个总的取法。思路:dp,背包思想,考虑第i个数,取或者不取,dp[i][j]表示在第i个数时,异或值为j的所有取法。dp[i][j] = dp[i - 1][j] + dp[i - 1][j ^ a[i]]);其中d...
分类:
移动开发 时间:
2015-09-22 23:19:31
阅读次数:
219
用于学习Workerman的虚拟机配置信息如下(至于环境的安装,请参考官方手册自行解决):DistributorID:UbuntuDescription:Ubuntu14.04LTSRelease:14.04Codename:trustyWorkerman:3.1.9PHPversion:5.5.9我们先用Workerman写第一个实例,实例目录如下:/var/happy├──Apps//我们..
分类:
其他好文 时间:
2015-09-22 19:06:09
阅读次数:
482