The number of divisors(约数) about Humble Numbers

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

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
 
如果n = p1a1p2a2p3a3...pnan 那么根据乘法原理,约数的个数为 (a1+1)*(a2+1)...(an+1)
#include <stdio.h>
#include <math.h>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <stdlib.h>
using namespace std;
typedef long long LL; int main()
{
LL n;
while(scanf("%lld",&n)!=EOF,n)
{
int cnt = ;
int a=,b=,c=,d=;
if(n%==)
{
while(n%==)
{
n/=;
a++;
}
}
if(n%==)
{
while(n%==)
{
n/=;
b++;
}
}
if(n%==)
{
while(n%==)
{
n/=;
c++;
}
}
while(n%==)
{
while(n%==)
{
n/=;
d++;
}
}
printf("%lld\n",(LL)(+a)*(+b)*(+c)*(+d));
}
}

hdu 1492(约数的个数)的更多相关文章

  1. 九度oj 题目1087:约数的个数

    题目链接:http://ac.jobdu.com/problem.php?pid=1087 题目描述: 输入n个整数,依次输出每个数的约数的个数 输入: 输入的第一行为N,即数组的个数(N<=1 ...

  2. 九度OJ 1087 约数的个数

    题目地址:http://ac.jobdu.com/problem.php?pid=1087 题目描述: 输入n个整数,依次输出每个数的约数的个数 输入: 输入的第一行为N,即数组的个数(N<=1 ...

  3. hdu 1028 母函数 一个数有几种相加方式

    ///hdu 1028 母函数 一个数有几种相加方式 #include<stdio.h> #include<string.h> #include<iostream> ...

  4. 问题 D: 约数的个数

    问题 D: 约数的个数 时间限制: 1 Sec  内存限制: 32 MB提交: 272  解决: 90[提交][状态][讨论版][命题人:外部导入] 题目描述 输入n个整数,依次输出每个数的约数的个数 ...

  5. 九度OJ 1087:约数的个数 (数字特性)

    时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:7349 解决:2306 题目描述: 输入n个整数,依次输出每个数的约数的个数 输入: 输入的第一行为N,即数组的个数(N<=1000) ...

  6. 【九度OJ】题目1087:约数的个数 解题报告

    [九度OJ]题目1087:约数的个数 解题报告 标签(空格分隔): 九度OJ 原题地址:http://ac.jobdu.com/problem.php?pid=1087 题目描述: 输入n个整数,依次 ...

  7. HDU 1452 (约数和+乘法逆元)

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1452 题目大意:求2004^X所有约数和,结果mod 29. 解题思路: ①整数唯一分解定理: 一个 ...

  8. HDU 1019 (多个数的最小公倍数)

    传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1019 Least Common Multiple Time Limit: 2000/1000 MS (J ...

  9. hdu 1258 从n个数中找和为t的组合 (DFS)

    题意:首先给你一个t,然后是n,后面输入n个数,然后让你求的是n个数中和为t的序列总共有多少种,把他们按从左到右的顺序输出来. Sample Input4 6 4 3 2 2 1 15 3 2 1 1 ...

随机推荐

  1. relu函数是否存在梯度消失问题以及relu函数的死亡节点问题

    relu函数是否存在梯度消失问题以及relu函数的死亡节点问题 存在,在小于的时候,激活函数梯度为零,梯度消失,神经元不更新,变成了死亡节点. 出现这个原因可能是因为学习率太大,导致w更新巨大,使得输 ...

  2. BFS:HDU2054-A==B?(字符串的比较)

    A == B ? Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total S ...

  3. webpack + babel + vue 环境设置

    npm i webpack --save-dev npm install style-loader css-loader url-loader babel-loader sass-loader fil ...

  4. “帮你APP”团队冲刺4

    1.整个项目预期的任务量 (任务量 = 所有工作的预期时间)和 目前已经花的时间 (所有记录的 ‘已经花费的时间’),还剩余的时间(所有工作的 ‘剩余时间’) : 所有工作的预期时间:88h 目前已经 ...

  5. go经典练习题涉及流程控制-字符串-struct-map的数据类型的处理

    one:求1到100之间的质数 package main import ( "fmt" ) func isPrime(n int) bool { var flag = true f ...

  6. PostgreSql基础命令及问题总结

    本章内容: 1.基本命令 基本命令 1.psql -U cdnetworks_beian -d cdnetworks_beian         #-U指定用户,-d指定数据库 2.\l        ...

  7. 图说不为人知的IT传奇故事-3-硅谷DNA创造者HP

    此系列文章为“图说不为人知的IT传奇故事”,各位大忙人可以在一分钟甚至几秒内了解把握整个内容,真可谓“大忙人的福利”呀!!希望各位IT界的朋友在钻研技术的同时,也能在文学.历史上有所把握.了解这些故事 ...

  8. psql 工具详细使用介绍

    psql 介绍 psql 是 PostgreSQL 中的一个命令行交互式客户端工具, 它允许你交互地键入 SQL 命令,然后把它们发送给 PostgreSQL 服务器,再显示 SQL 或命令的结果. ...

  9. 贪吃蛇—C—基于easyx图形库(下):从画图程序到贪吃蛇【自带穿墙术】

    上节我们用方向控制函数写了个小画图程序,它虽然简单好玩,但我们不应该止步于此.革命尚未成功,同志还需努力. 开始撸代码之前,我们先理清一下思路.和前面画图程序不同,贪吃蛇可以有很多节,可以用一个足够大 ...

  10. VMSAv8-64 translation table format descriptors

    通常情况下,一个 descriptor 可能是以下的几种 entry: 非法或者异常的 entry. Table entry, 指向 next-level translation table. Blo ...