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. Linux文件权限管理(持续更新)

    文章是从我的个人博客上粘贴过来的, 大家也可以访问我的主页 www.iwangzheng.com 以root身份登录linux以后, ls -al 可以看到 -rw-rw-r--  1 wangzhe ...

  2. poj1328贪心 雷达,陆地,岛屿问题

    Radar Installation Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 60381   Accepted: 13 ...

  3. Linux MySQL差异备份技巧

    MSSQL差异备份使用技巧 15 Apr 2013 所谓的差异备份,就是只备份最近一次备份之后到此次备份之前所增加的那一部分数据.打个比方我第N次备份后数据库存放的内容是ABCD,然后我第N+1次 备 ...

  4. 重新编译安装gcc-4.1.2(gcc版本降级)之TFS安装

    wget http://gcc.parentingamerica.com/releases/gcc-4.1.2/gcc-4.1.2.tar.gz tar -zxfv gcc-4.1.2.tar.gz ...

  5. 【云计算】Docker集中化web界面管理平台shipyard

    Docker集中化web界面管理平台shipyard docker shipyard seanlook                        2015年01月05日发布             ...

  6. JavaScript封装成类

    JavaScript在WEB编程中能起到很大的作用,将一些常用的功能写成JavaScript类库. 将下面代码保存为Common.js 类库功能: 1.Trim(str)--去除字符串两边的空格 2. ...

  7. ios xcode Could not load the "MyImage.png" image referenced from a nib in the bundle with identifier "com.mytest.MyProject"

    出现找不到xib指定的图片,需要指定图片的完整路径,不能只是图片名 详见:http://vocaro.com/trevor/blog/2012/10/21/xcode-groups-vs-folder ...

  8. 案例(JQuery的ajax无刷新评论)

    CommentsTest.html代码: <head> <meta http-equiv="Content-Type" content="text/ht ...

  9. php 面向对象的方式访问数据库

    <body> <?php //面向对象的方式访问数据库 //造对象 $db = new MySQLi("localhost","root",& ...

  10. Vim的文件加密

    X----->(大写的X)是加密 取消文件密码:进入文件编辑模式 重复vim加密 只是输入密码时为空(直接回车)--->:w ~ Warning: Using a weak encrypt ...