摘要: 就是一个二分法快速幂。 但是需要注意的问题是这里是实数,而且n可能为负。int的范围是-2,147,483,648 至 2,147,483,647。如果为-2,147,483,648那么直接n=-n就爆int了。所以先要把n换成longlong。 阅读全文
posted @ 2016-04-21 14:37 周洋 阅读(274) 评论(0) 推荐(0) 编辑
摘要: Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum pro 阅读全文
posted @ 2016-04-21 02:03 周洋 阅读(3456) 评论(0) 推荐(0) 编辑