The number of divisors(约数) about Humble Numbers[HDU1492]
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]的更多相关文章
- The number of divisors(约数) about Humble Numbers
The number of divisors(约数) about Humble Numbers Time Limit: 2000/1000 MS (Java/Others) Memory Lim ...
- HDU1492/The number of divisors(约数) about Humble Numbers
题目连接 The number of divisors(约数) about Humble Numbers Time Limit: 2000/1000 MS (Java/Others) Memory L ...
- HDUOJ---The number of divisors(约数) about Humble Numbers
The number of divisors(约数) about Humble Numbers Time Limit: 2000/1000 MS (Java/Others) Memory Lim ...
- 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 ...
- 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, ...
- hdu-1492 The number of divisors(约数) about Humble Numbers---因子数公式
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1492 题目大意: 给出一个数,因子只有2 3 5 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 ...
- A - Humble Numbers
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Pract ...
- Humble Numbers
Humble Numbers Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 9988 Accepted: 4665 Descri ...
随机推荐
- ios反射
http://www.cr173.com/html/18677_1.html 1.反射获取类属性名和属性类型 unsigned ; objc_property_t *properties = clas ...
- 【Hadoop】HIVE 小结概览
一.HIVE概览小结 二.HIVE安装 Hive只在一个节点上安装即可 .上传tar包 .解压 tar -zxvf hive-.tar.gz -C /cloud/ .配置mysql metastore ...
- 【JavaScript】ReactJS&NodeJS了解资料
ReactJS: GitHub:https://github.com/facebook/react React 入门实例教程:http://www.ruanyifeng.com/blog/2015/0 ...
- h5在微信中不允许放大缩小页面
在头部添加 <meta name="viewport" content="width=device-width, initial-scale=1, maximum- ...
- 【转】Kettle集群
本文转自:http://blog.csdn.net/dqswuyundong/article/details/5952009 Kettle集群 Kettle是一款开源的ETL工具,以其高效和可扩展性而 ...
- [Linux] AWK命令详解(大全)
转载自:http://caoyanbao.iteye.com/blog/570868 什么是awk? 你可能对UNIX比较熟悉,但你可能对awk很陌生,这一点也不奇怪,的确,与其优秀的功能相比,awk ...
- php 工厂模式
<body> <?php //设计模式:工厂模式 /* class YunSuan { public $a; public $b; function Jia() { return ( ...
- 《Java程序性能优化》学习笔记 程序优化
这一部分主要介绍代码层的优化.了解如何编写高效而精炼的代码,正确的使用函数方法.1.字符串优化处理Java语言中,String对象可以认为是对char数组的眼神和进一步封装.它主要由3部分组成:cha ...
- 如何将win7安装到 移动硬盘/U盘 及 VHD、BCD等相关知识 链接汇总
如何将win7安装到 移动硬盘/U盘? 从u盘启动win7/2008 R2的方法,更新:换机器免sysprep的方法:http://www.360doc.com/content/11/1103/14/ ...
- [译] Web API 之 简介
事实上,MVC 框架本身已经提供了构建REST风格服务的基础,而Web API 只是让你可以更加容易和快捷的构建REST服务. 特性 基于约定的 CRUD Actions: 自动按照HTTP的acto ...