Nim is a 2-player game featuring several piles of stones. Players alternate turns, and on his/her turn, a player’s move consists of removing one or more stones from any single pile. Play ends when all the stones have been removed, at which point the last p...
分类:
其他好文 时间:
2015-04-01 15:21:45
阅读次数:
197
存在一个数组,该数组中仅有一个数仅出现了一次,其他所有数均出现两次,求这个数 思路:任何一个数和自身求异或操作都是0,任何一个数和0求异或操作都是它自身 class Solution {public: int singleNumber(int A[], int n) { int res=0; for...
分类:
其他好文 时间:
2015-04-01 14:58:29
阅读次数:
124
原文:http://www.codeceo.com/article/23-design-parttens-single-partten.html定义:确保一个类只有一个实例,而且自行实例化并向整个系统提供这个实例。类型:创建类模式类图:类图知识点:1.类图分为三部分,依次是类名、属性、方法2.以>结...
分类:
其他好文 时间:
2015-04-01 12:56:09
阅读次数:
87
下载Sublime Text
链接
http://www.sublimetext.com/3
我下载的是win32 portable 版 便于放入U盘携带
解压
注册: 可以复制以下部分直接贴入注册栏
----- BEGIN LICENSE -----
K-20
Single User License
EA7E-940129
3A099EC1 C0B5C7C5 33EBF0CF BE...
分类:
其他好文 时间:
2015-04-01 07:04:23
阅读次数:
189
LeetCode #Single Number#
刚背了单词,然后做个题玩玩~挑个软柿子踩踩~哈哈
很简单的思路.不过好玩的是我忘记检查处理完的数据是否符合整形数据返回了.因而好一会儿不能AC.
感谢 @Fantasy. 很快的指出我没有检查返回数据的范围.
先给出我超丑陋的解(python), 而后给出其他高手给出的很优雅的解!!也是用pyth...
分类:
其他好文 时间:
2015-04-01 00:24:47
阅读次数:
138
grep简介正如linux的man文件中所描述的那样: grep searches the named input FILEs (or standard input if no files are named, or if a single hyphen-minus (-) is given as file name) for lines containing a match to...
分类:
其他好文 时间:
2015-03-31 22:21:16
阅读次数:
167
Vasya is sitting on an extremely boring math class. To have fun, he took a piece of paper and wrote out nnumbers on a single line. After that, Vasya b...
分类:
其他好文 时间:
2015-03-31 21:46:52
阅读次数:
196
解法一: 人类需要O(n)去解决问题,于是普罗米修斯不管三七二十一就偷来了Hash...
Python里面内置的dic好用到不行.这里可以利用Hash把时间复杂度降到O(n),但是这种解法不满足对内存的要求...
"""
Programmer : EOF
Code date : 2015.03.02
file : sn.py
e-mail :...
分类:
其他好文 时间:
2015-03-31 06:50:01
阅读次数:
155
https://leetcode.com/problems/regular-expression-matching/Implement regular expression matching with support for'.'and'*'.'.' Matches any single chara...
分类:
其他好文 时间:
2015-03-30 22:52:12
阅读次数:
220
1、前期准备 在学习推送开发之前,开发者需要两样东西,(1)、iPhone真机,因为模拟器不支持推送(2)、付费的开发者账号。 2、新建项目,选择Single View Application模板。 3、注册通知(Registration Notifi...
分类:
移动开发 时间:
2015-03-30 21:20:58
阅读次数:
156