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. Excel 批量快速合并相同的单元格:数据透视表、宏代码、分类汇总

    Excel 批量快速合并相同的单元格   在制作Excel表格的时候,为了使得自己制作的报表更加简洁明了,方便查阅,经常需要合并很多相同的单元格,如果有几千几万条记录需要合并的话,真的会让人发疯.怎样 ...

  2. C语言编程规范

    C语言编程规范 6 函数与过程 6.1 函数的功能与规模设计 函数应当短而精美,而且只做一件事.不要设计多用途面面俱到的函数,多功能集于一身的函数,很可能使函数的理解.测试.维护等变得困难. 6.2 ...

  3. Endianess(字节次序)简介

    1. 基础 在解释Endianess前,需要先明白几个基础定义 1) 数据的高位与低位是什么 以1001001为例,则从左边算起是 高位 -> 低位, 简而言之就是左边是高位,右边是低位 而内存 ...

  4. 【BZOJ】【3240】【NOI2013】矩阵游戏

    十进制快速幂+矩阵乘法+常数优化 听说这题还可以强行算出来递推式……然后乘乘除除算出来…… 然而蒟蒻选择了一个比较暴力的做法= = 我们发现这个递推的过程是线性的,所以可以用矩阵乘法来表示,$x=a* ...

  5. angular之interceptors拦截器

    <!DOCTYPE html> <html ng-app="nickApp"> <head> <meta charset="UT ...

  6. PHP的CLI综合

    tip1:传入参数 使用标准的输入和输出    PHP CLI会定义三个常量,以便让在命令行提示符下与解释器进行交互操作更加容易.这些常量见表格A.表格A 常量 说明STDIN 标准的输入设备STDO ...

  7. Linux内核设计基础(四)之虚拟文件系统

    先来看一下写文件函数write的运行过程: ret = write(fd, buf, len); write适用于各种文件系统.它首先运行sys_write(),而正是这个sys_write()进行实 ...

  8. AsyncTask 和 Thread 区别

    一.AsyncTask是封装好的线程池,比起Thread+Handler的方式,AsyncTask在操作UI线程上更方便,因为onPreExecute().onPostExecute()及更新UI方法 ...

  9. WebService 之 已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性。

    在使用 WCF 中,遇到如下问题: 已超过传入消息(65536)的最大消息大小配额.若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性. 问题说明: 客户端调用 ...

  10. 开源 免费 java CMS - FreeCMS1.5-数据对象-job

    下载地址:http://code.google.com/p/freecms/ job 从FreeCMS 1.5 开始支持 在使用职位相关标签时,标签会封装job供页面调用. 属性 说明 id id s ...