The number of divisors (approximate) about Humble numbers--hdu1492

Source: Internet
Author: User

http://acm.hdu.edu.cn/showproblem.php?pid=1492

The main topic: give you a n this n his vegetarian factor is only 2 3 5 7 This four number no other factor factor n is 2 of the 64-th

Analysis: Just ask for the number of his factor to multiply each plus one.

#include <cstdio>#include<cstring>#include<stack>#include<vector>#include<queue>#include<cmath>#include<cstdlib>#include<iostream>#include<algorithm>using namespacestd;#defineN 30#defineMemset (A, B) memset (A,b,sizeof (a))intA[n];voidSerch (Long Long intN) {memset (A,0); intI=0; intb[4]={2,3,5,7};  while(n!=1)    {        if(n%b[i]==0) {A[b[i]]++; N=n/B[i]; }        Else{i++; }    }}intMain () {Long Long intN;  while(SCANF ("%lld",&N), N) {serch (n); Long Long intSum= (a[2]+1) * (a[3]+1) * (a[5]+1) * (a[7]+1); printf ("%lld\n", sum); }    return 0;}

The number of divisors (approximate) about Humble numbers--hdu1492

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.