# The number of divisors(约数) about Humble Numbers

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2039    Accepted Submission(s): 1002

Problem Description

A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, ... shows the first 20 humble numbers. Now given a humble number, please write a program to calculate the number of divisors about this humble number.For examle, 4 is a humble,and it have 3 divisors(1,2,4);12 have 6 divisors.

Input

The input consists of multiple test cases. Each test case consists of one humble number n,and n is in the range of 64-bits signed integer. Input is terminated by a value of zero for n.

Output

For each test case, output its divisor number, one line per case.

Sample Input

4 12 0

Sample Output

3 6

Author

lcy

Source

Recommend

LL

``` 1 //http://acm.hdu.edu.cn/showproblem.php?pid=1492
2 #include<iostream>
3 #include<cstdio>
4 using namespace std;
5 int main()
6 {
7     _int64 i,n,c1,c2,c3,c4;
8
9     while(scanf("%I64d",&n),n)
10     {
11         for(c1=1,i=n;i%2==0&&i!=0;i/=2)
12                    c1++;
13         for(c2=1,i=n;i%3==0&&i!=0;i/=3)
14                     c2++;
15         for(c3=1,i=n;i%5==0&&i!=0;i/=5)
16                     c3++;
17          for(c4=1,i=n;i%7==0&&i!=0;i/=7)
18                     c4++;
19         printf("%I64d\n",c1*c2*c3*c4);
20     }
21 return 0;
22 }```

657 篇文章64 人订阅

0 条评论

## 相关文章

### POJ-1887 Testing the CATCHER（dp,最长下降子序列）

Testing the CATCHER Time Limit: 1000MS Memory Limit: 30000K Total Submi...

3665

### HDUOJ------1711Number Sequence

Number Sequence Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/3...

3046

### HDU 3367 Pseudoforest(Kruskal)

Pseudoforest Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/655...

3045

### ZOJ 3607 Lazier Salesgirl (枚举)

Lazier Salesgirl Time Limit: 2 Seconds Memory Limit: 65536 KB Kochiya S...

3697

### HDU 5651 xiaoxin juju needs help

xiaoxin juju needs help Time Limit: 2000/1000 MS (Java/Others)    Memory Limit:...

2997

### HDU 5676 ztr loves lucky numbers

ztr loves lucky numbers Time Limit: 2000/1000 MS (Java/Others)    Me...

3735

### HDOJ 1013

Digital Roots Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/327...

2048

### HDU 2289 Cup【高精度，二分】

Cup Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/...

2515

### POJ--3468 A Simple Problem with Integers(线段树)

A Simple Problem with Integers Time Limit: 5000MS Memory Limit: 131072K ...

3444

### HDU 3309 Roll The Cube(bfs)

Roll The Cube Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/327...

41513