摘要:
就是一个二分法快速幂。 但是需要注意的问题是这里是实数,而且n可能为负。int的范围是-2,147,483,648 至 2,147,483,647。如果为-2,147,483,648那么直接n=-n就爆int了。所以先要把n换成longlong。 阅读全文
摘要:
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 阅读全文