【剑指offer】q34:丑数
来源:互联网 发布:杭州辉图软件 编辑:程序博客网 时间:2024/06/01 07:58
题目要求第n个丑数,所以对于中间结果不需要保存。
def Humble(index):curHum = 1M2 = 2; M3 = 3; M5 = 5while index > 1:curHum = min(min(M2, M3), M5)while M2 <= curHum:M2 *= 2while M3 <= curHum:M3 *= 3while M5 <= curHum:M5 *= 5index -= 1return curHum
0 0
- 【剑指offer】q34:丑数
- Q34:丑数
- 【剑指offer】丑数
- 剑指offer-丑数
- 《剑指offer》丑数
- 【剑指Offer】丑数
- 剑指offer:丑数
- 剑指offer-丑数
- [剑指offer]丑数
- 剑指offer:丑数
- [剑指offer]丑数
- 《剑指offer》-丑数
- 剑指offer----丑数
- 剑指offer|丑数
- 剑指offer-丑数
- 剑指Offer:丑数
- 剑指offer--丑数
- 剑指offer-丑数
- 黑马程序员——黑马学习日志之二十一 Java高新技术(三)
- 6-2. 字符串字母大小写转换(10)
- java 使用commons-logging和log4j记录日志
- 嵌入式互联互通技术 ---- RapidIO 总线技术介绍
- 服务器安全配置
- 【剑指offer】q34:丑数
- vmware 克隆linux虚拟机后设置网卡
- Notification(通知)
- poj 1511 SPFA
- [hadoop学习笔记] 之 eclipse插件操作hdfs出现的权限问题
- 黑马程序员——黑马学习日志之二十二 Java高新技术(四)
- Eclipse使用Maven创建Web时错误:Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webap
- 老美优惠券获取攻略和相关产品用例分析
- SQL Server中如何批量导入数据