The number of divisors(约数) about Humble Numbers

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

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
“2006校园文化活动月”之“校庆杯”大学生程序设计竞赛暨杭州电子科技大学第四届大学生程序设计竞赛

Recommend
LL

#include<stdio.h>
int main()
{
__int64 n,p1,p2,p3,p4;
while (scanf("%I64d",&n)!=EOF)
{
if (n==) return ;
p1=p2=p3=p4=;
while (n && n%==)
{
p1++;
n/=;
}
while (n && n%==)
{
p2++;
n/=;
}
while (n && n%==)
{
p3++;
n/=;
}
while (n && n%==)
{
p4++;
n/=;
}
printf("%I64d\n",p1*p2*p3*p4);
}
return ;
}

The number of divisors(约数) about Humble Numbers[HDU1492]的更多相关文章

  1. The number of divisors(约数) about Humble Numbers

    The number of divisors(约数) about Humble Numbers Time Limit: 2000/1000 MS (Java/Others)    Memory Lim ...

  2. HDU1492/The number of divisors(约数) about Humble Numbers

    题目连接 The number of divisors(约数) about Humble Numbers Time Limit: 2000/1000 MS (Java/Others) Memory L ...

  3. HDUOJ---The number of divisors(约数) about Humble Numbers

    The number of divisors(约数) about Humble Numbers Time Limit: 2000/1000 MS (Java/Others)    Memory Lim ...

  4. HDU - The number of divisors(约数) about Humble Numbers

    Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence ...

  5. HDU-1492-The number of divisors(约数) about Humble Numbers -求因子总数+唯一分解定理的变形

    A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, ...

  6. hdu-1492 The number of divisors(约数) about Humble Numbers---因子数公式

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1492 题目大意: 给出一个数,因子只有2 3 5 7,求这个数的因子个数 解题思路: 直接求出指数即 ...

  7. [poj2247] Humble Numbers (DP水题)

    DP 水题 Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The se ...

  8. A - Humble Numbers

    Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Pract ...

  9. Humble Numbers

    Humble Numbers Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 9988 Accepted: 4665 Descri ...

随机推荐

  1. [Effective JavaScript 笔记]第40条:避免继承标准类

    ECMAScript标准库里配备了许多重要的类,如Array,function,以及Date等.扩展这些类生成子类可以方便完成很多工作,但它们的定义具有很多特殊的行为,所以很难写出行为正确的类. Ar ...

  2. Linux下读取默认MAC地址

    导读MAC(Media Access Control,介质访问控制)计算机通过它来定义并识别网络设备的位置.在嵌入式linux学习中不可避免也会遇到MAC,本文主要描述了如何通过操作OTP来读取嵌入式 ...

  3. mac os 安装 pkg-config

    wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.29.tar.gz . env LDFLAGS="-framework ...

  4. 向着目标杀jj

     海外资深实力公司招聘:1.PHP工程师,18-25K2.UI设计师,15-25K3.前端工程师,18-25K4.Python工程师,18-25K5.DBA工程师,18-25K6.服务端工程师,18- ...

  5. SQL注入--宽字节注入

    PHP测试代码: <?php // 面向对象写法 $id=addslashes($_GET[‘id’]); //获取id并转义预定义字符 // /$id=$_GET[‘id’]; $mysqli ...

  6. [转载]WiFi有死角? 巧用旧无线路由器扩展覆盖

    怎么了,家里的WiFi有死角?老旧无线路由器的无线覆盖不给力?现在大功率无线产品或双频无线产品的售价并不便宜,而且仅靠一台无线路由器并不能满足多户型家庭的无线覆盖需求.那么,是不是有什么廉价而又实用的 ...

  7. django inclusion_tag

    一种比较普遍的tag类型是只是渲染其它模块显示下内容,这样的类型叫做Inclusion Tag. 例如,实现以下tag: {% books_for_author author %} 渲染结果为: &l ...

  8. 通过Java反射来理解泛型的本质

    集合框架中经常会使用泛型指定集合中所存放元素的类型,保证集合的统一性,从集合中取出元素的时候也避免了类型强制转换的操作,所以我们使用常规的方式来往集合中存放元素的时候,如果指定泛型,那么我们只能向集合 ...

  9. JSON和GSON操作json数据

    1,JSON操作json import net.sf.json.JSONArray; import net.sf.json.JSONObject; //json操作数据 public static S ...

  10. iOS PickerView动态加载数据

    将新的数据放入临时数组 NSMutableArray *tmp=[[NSMutableArray alloc] init]; [tmp addObject:[[NSString alloc] init ...