Number Sequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 187893 Accepted Submission(s): 46820 Problem Description A number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (A…
函数求值 题意: 定义函数g(n)为n最大的奇数因子.求f(n)=g(1)+g(2)+g(3)+-+g(n).1<=n<=10^8; 思路: 首先明白暴力没法过.问题是如何求解,二分.知道奇数的最大因子是他本身,并且小于等于n的奇数的和很容易就可以求出来(等差数列).那么剩下的偶数除以2得到n`,然后去求小于等于n`的奇数,最后得解. <long long> #include<cstdio> typedef long long LL; int main () { LL…
Ipad,IPhone Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 100 Accepted Submission(s): 46 Problem Description In ACM_DIY, there is one master called “Lost”. As we know he is a “-2Dai”, which me…