The 12th session of Fuzhou University program design competition b. Perfect numbers

Source: Internet
Author: User

problem B the perfect numberTime limit:1000 mSec Memory limit:32768 KBProblem Description

Bob is a kid who likes numbers, and now he's working on a number-related topic, and we know that the perfect degree of a number is the number of methods that divide this number into three integers multiplied by a*a*b (0<a<=b), such as the number 80 can be decomposed into 1*1*80,2*2*20, 4*5, so the perfect degree of 80 is 3; The number 5 has only one decomposition method 1*1*5, so the perfect degree is 1, assuming the digital x is the perfect degree of D (x), now given a B (a<=b), please help Bob to find out

S,s represents the sum of the prevalence of all numbers from a to B, i.e. S=d (a) +d (a+1) +...+d (b).

Input two integers a, b (1<=a<=b<=10^15) output outputs an integer that represents the sum of all the digital popularity from A to B. Sample Input 1 Sample Output 107
violent running words will time out, slightly turn a bend on the line, each time just calculate the head and tail, minus a bit OK, the code is as follows:




The 12th session of Fuzhou University program design competition b. Perfect numbers

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.