The number of divisors(约数) about Humble Numbers

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

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
 #include <cstdio>
#include <iostream>
using namespace std;
int main()
{
long long n;
while(cin>>n&&n)
{
long long a[]={,,,};
int b[]={,,,},i;
for(i=;i<;i++)
{
while(n%b[i]==)
{
a[i]++;
n=n/b[i];
}
}
cout<<a[]*a[]*a[]*a[]<<endl;
}
}
 

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. 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. nginx日志管理与限速

    1.日志简介nginx日志主要有两种:访问日志和错误日志.访问日志主要记录客户端访问nginx的每一个请求,格式可以自定义:错误日志主要记录客户端访问nginx出错时的日志,格式不支持自定义.两种日志 ...

  2. Django 反向生成 从数据库生成Model

    Django 反向生成 从数据库生成Model 使用Django生成Model python manage.py inspectdb或python manage.py inspectdb > m ...

  3. WINAPI大全~

    http://www.alsprogrammingresource.com/win32_functions_g.html

  4. SHELL种类,版本及选择

    SHELL种类,版本及选择 凡是使用 *INX 的人,不论是作为 login shell 还是编程,多少都要接触到 Shell.经过多年的发展, Shell 的种类繁多.除了我们熟悉的 sh.ksh. ...

  5. CString 的一些事

    MFC Visual Studio 2008 CString 的 Format 中不能这样存在str.Format(_T("Cool(\%)"));  或者 str.Format( ...

  6. spftlayer 安装及简单使用

    1,yum -y install python-pip; pip(Python packet index);

  7. C#中,表达式的计算遵循一个规律:从左到右依次计算。

    int i = 0; int j = (i++)+(i++)=(i++)+i=i+++i=i+++i++=1;

  8. 《招聘一个靠谱的iOS》面试题参考答案(上)

    说明:面试题来源是微博@我就叫Sunny怎么了的这篇博文:<招聘一个靠谱的 iOS>,其中共55题,除第一题为纠错题外,其他54道均为简答题. 博文中给出了高质量的面试题,但是未给出答案, ...

  9. UIView 转 UIImage

    这个方法很实用,特别是在做水印相机得时候... - (UIImage*) imageWithUIView:(UIView*) view{ // 创建一个bitmap的context // 并把它设置成 ...

  10. Cookie知识点小结

    问题是什么?有哪些技术?如何解决? 1. Cookie 1)完成回话跟踪的一种机制:采用的是在客户端保存Http状态信息的方案 2)Cookie是在浏览器访问WEB服务器的某个资源时,由WEB服务器在 ...