发布时间:2016-03-25 10:59:31
class singleton(type): def __new__(cls, name, bases, dict): old_init = dict.get('__init__') old_new = super(cls.__class__, cls).__new__ def _wrap_init(self, *args, **kwargs): .........【阅读全文】
发布时间:2014-07-25 11:01:30
通常 f(n) = m*f(n-1)+nn太大深度太深,就不能计算了此时可以做个变通,让f有记忆功能,然后在外面for i in range(n): f(i)从而绕开递归深度的问题sample:#this will....def f(n): if n < 2: return 1 return f(n-1)+f(n-2)#to this,will work finedRes = {}d.........【阅读全文】