摘要:
``` #!/usr/bin/env python #coding:utf-8 import sys import math def prime_split(number): i = 2 sqrt_ = math.sqrt(number) while i <= sqrt_: mod_ = number % i if mod_ == 0: ... 阅读全文
摘要:
``` #!/usr/bin/env python #coding:utf-8 SET_START = 1 SET_END = 9 SUB_LEN = 10 def r_subset(i, r, pre, array, sub): if i == r: print sub return j = pre len_ = len(ar... 阅读全文
摘要:
```python #!/usr/bin/env python #coding:utf-8 import sys def gray_code(n): if n < 1: return [] n += 1 array = ["0", "1"] for i in xrange(2, n): times = 2 ** (i-1) ... 阅读全文
摘要:
``` #!/usr/bin/env python #coding:utf-8 import sys def gray_code(num, array): if num < 1: return if num == 1: array.append('0') array.append('1') return g... 阅读全文