生成器generator 定义:一个函数调用时返回一个迭代器,那这个函数就叫做生成器(generator),如果函数中包含yield语法,那这个函数就会变成生成器 代码: def cash_out(amount): while amount >0: amount -= 1 yield 1<br> p
分类:
其他好文 时间:
2016-02-16 21:57:13
阅读次数:
201
新年啦,大家新年快乐~~ 由于新年呢,所以最近很少做题,今天终于有时间可以打打代码了 134. Gas Station. There are N gas stations along a circular route, where the amount of gas at station i is
分类:
其他好文 时间:
2016-02-12 17:32:27
阅读次数:
201
Handle faults that may take a variable amount of time to rectify when connecting to a remote service or resource. This pattern can improve the stabili
分类:
其他好文 时间:
2016-02-06 01:42:43
阅读次数:
268
import UIKit // 值类型的构造器重载 struct ConstructorOverload { var name: String! var amount: Int! // 提供无参数的构造器 init(){ } // 提供带两个参数的构造器来完成构造过程 init(name: Stri
分类:
其他好文 时间:
2016-02-05 19:09:58
阅读次数:
124
You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you nee
分类:
其他好文 时间:
2016-01-29 21:13:20
阅读次数:
147
数位DP,题意转换一下就是说,其B进制表示的各位数字都只能是0和1。 求区间L....R之间的符合要求数字有几个,可以使用容斥原理。 计算小于X的符合要求的数有几个的时候,我们需要先找到比X小的最大的符合要求的数字,然后以这个数字往下推导,和之前做的数位DP方法一样了。 dp[i][j][k]表示的
分类:
其他好文 时间:
2016-01-29 12:11:58
阅读次数:
156
(一)数位DP 1057. Amount of Degrees Time limit: 1.0 secondMemory limit: 64 MB Create a code to determine the amount of integers, lying in the set [X;Y] an
分类:
其他好文 时间:
2016-01-27 16:59:15
阅读次数:
201
ALN: 字母数字字符,混合大小写,最大长度取决于数据库 Oracle = 4000 个字符 Sql Server = 8000 个字符 DB2 = 32672 个字符AMOUNT:小数,用于货币BIGINT:大整数BLOB:二进制大对象,在数据库内的单个记录中存储 JPEG、电影或PDF...
分类:
数据库 时间:
2016-01-20 19:15:24
阅读次数:
241
You are given coins of different denominations and a total amount of moneyamount. Write a function to compute the fewest number of coins that you need...
分类:
其他好文 时间:
2016-01-18 06:53:23
阅读次数:
200
1.yii数据查询 a.使用CDbCriteria数据查询 $attributes=array(); $criteria=newCDbCriteria; //$criteria->select=‘amount‘; $criteria->condition=‘user_id=:user_id‘; $criteria->params=array(‘:user_id‘=>18889195); $DwCouponModel=newCoupon(); $clas..
分类:
其他好文 时间:
2016-01-15 17:57:28
阅读次数:
203