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
分解质因数
 //http://acm.hdu.edu.cn/showproblem.php?pid=1492
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
_int64 i,n,c1,c2,c3,c4; while(scanf("%I64d",&n),n)
{
for(c1=,i=n;i%==&&i!=;i/=)
c1++;
for(c2=,i=n;i%==&&i!=;i/=)
c2++;
for(c3=,i=n;i%==&&i!=;i/=)
c3++;
for(c4=,i=n;i%==&&i!=;i/=)
c4++;
printf("%I64d\n",c1*c2*c3*c4);
}
return ;
}

HDUOJ---The number of divisors(约数) about Humble Numbers的更多相关文章

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

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

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

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

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

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

  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. my.cnf 配置文件参数解释

    my.cnf 配置文件参数解释: #*** client options 相关选项 ***# #以下选项会被MySQL客户端应用读取.注意只有MySQL附带的客户端应用程序保证可以读取这段内容.如果你 ...

  2. 【BZOJ】【2694】Lcm

    数论/莫比乌斯反演/线性筛 题解:http://www.cnblogs.com/zyfzyf/p/4218176.html JZPTAB的加强版?感觉线性筛好像还是不怎么会啊……sad 题目记下来,回 ...

  3. GeoHash核心原理解析及java代码实现(转)

    原文链接:http://blog.jobbole.com/80633/ 引子 机机是个好动又好学的孩子,平日里就喜欢拿着手机地图点点按按来查询一些好玩的东西.某一天机机到北海公园游玩,肚肚饿了,于是乎 ...

  4. Zabbix named 监控

    Named 监控 配置 named.conf ,在options 配置节增加如下配置(同时检查/var/named 文件夹权限),然后重启named服务. tatistics-file "/ ...

  5. 第十一章 AtomicInteger源码解析

    1.原子类 可以实现一些原子操作 基于CAS 下面就以AtomicInteger为例. 2.AtomicInteger 在没有AtomicInteger之前,对于一个Integer的线程安全操作,是需 ...

  6. 九度OJ 打印日期 (模拟)

    题目1186:打印日期 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:4284 解决:1483 题目描写叙述: 给出年分m和一年中的第n天,算出第n天是几月几号. 输入: 输入包含两个整数 ...

  7. Discuz上传错误

    换了服务器后,上传图片的时候,显示上传100%,然后报错:upload error: 500.怎么回事那? [解决方法] 原来是php上传文件的时候,会首先上传到一个临时目录.如果临时目录没有权限,就 ...

  8. textarea光标移到末尾兼容ie,ffchrome

    function moveEnd(obj){         obj.focus();         var len = obj.value.length;         if (document ...

  9. POJ--2449--Remmarguts&#39; Date【dijkstra_heap+A*】第K短路

    链接:http://poj.org/problem?id=2449 题意:告诉你有n个顶点,m条边.并把这些边的信息告诉你:起点.终点.权值.再告诉你s.t.k.需求出s到t的第k短路,没有则输出-1 ...

  10. C#.NET常见问题(FAQ)-如何把写好的类编译成dll文件

    1 新建一个类库项目   2 直接改写这个Class1.cs文件   3 记得要添加Windows.Forms引用   4 我直接把在别的项目中做好的cs文件搞到这里来,连文件名也改了(FilesDi ...