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
http://acm.hdu.edu.cn/showproblem.php?pid=1492 
Recommend
LL
分解质因数

 1 //http://acm.hdu.edu.cn/showproblem.php?pid=1492
 2 #include<iostream>
 3 #include<cstdio>
 4 using namespace std;
 5 int main()
 6 {
 7     _int64 i,n,c1,c2,c3,c4;
 8
 9     while(scanf("%I64d",&n),n)
10     {
11         for(c1=1,i=n;i%2==0&&i!=0;i/=2)
12                    c1++;
13         for(c2=1,i=n;i%3==0&&i!=0;i/=3)
14                     c2++;
15         for(c3=1,i=n;i%5==0&&i!=0;i/=5)
16                     c3++;
17          for(c4=1,i=n;i%7==0&&i!=0;i/=7)
18                     c4++;
19         printf("%I64d\n",c1*c2*c3*c4);
20     }
21 return 0;
22 }

View Code

HDUOJ---The number of divisors(约数) about Humble Numbers相关推荐

  1. HDU 1492 The number of divisors(约数) about Humble Numbers(数论,简单约数)

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

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

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

  3. 杭电1492 The number of divisors(约数) about Humble Numbers

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

  4. HDU1492 The number of divisors(约数) about Humble Numbers【约数】

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

  5. 图论 + 数论 ---- CF1325E E. Ehab‘s REAL Number Theory Problem (约数个数 + 枚举 + bfs找最小环)[从图结构优化搜索]

    题目链接 题目大意: 给你nnn个数,每个数保证约数个数不超过777个.问你从中选出若 干个数的乘积是完全平方数,最少要选择多少个数?,不存在输出-1. 题目思路: 1.每个数约数不超过7个→\rig ...

  6. poj 2247 Humble Numbers

    Humble Numbers Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9453   Accepted: 4440 题目 ...

  7. HDU1058 Humble Numbers

    题目:Humble Numbers humble number从1为"始祖",剩下的所有数,其实都是在此基础上乘以2,3,5,7演化出来的,代码主要语句:f[t]=min(2*f[ ...

  8. NUC1077 Humble Numbers【数学计算+打表】

    Humble Numbers 时间限制: 1000ms 内存限制: 65536KB 通过次数: 1总提交次数: 1 问题描述 A number whose only prime factors are ...

  9. NUC1077 Humble Numbers【数学计算+打表+水题】

    Humble Numbers 时间限制: 1000ms 内存限制: 65536KB 通过次数: 1总提交次数: 1 问题描述 A number whose only prime factors are ...

最新文章

  1. Nature Method :Rob Knight发布Striped UniFrac算法轻松分析微生物组大数据
  2. 自律到极致-人生才精致:第6期
  3. linux安装显卡驱动的run文件,Linux系统下安装NVIDIA显卡驱动(run格式文件)
  4. Java 原生日志 java.util.logging
  5. [转载]HTTP PUSH技术原理,结合ASP.NET实现以及评述
  6. 关于HTML的面试题-html4/css2篇
  7. 2018程序员最佳ssh免费登陆工具
  8. vi交互式批量替换 vi批量替换 vi查找和替换
  9. HTML里img标签里的alt属性解释
  10. iphone5s已停用连接itunes怎么办?苹果5s已停用连接itunes解决方法
  11. day14_html和css
  12. DolphinScheduler征稿 —手把手教你如何使用小豚调度
  13. 奇迹Mu分析 - NPC相关操作
  14. win10升级后蓝牙不见了,设备管理器里没有,多了个串行控制器里的未知USB设备?...
  15. python常用基础库:标准库和第三方库
  16. 西北乱跑娃 --- opencv泛洪填充学习笔记
  17. 小熊派开发板移植RT-FOTA
  18. 都是学 AI,为什么别人薪资比你高?
  19. android屏幕解锁图案,安卓手机图案屏幕锁解锁方法!!
  20. 淘宝店铺订单自动发货解决方案

热门文章

  1. 广东 职称英语计算机,现在评职称英语和计算机都不用考了
  2. string转short java_[Java基础]之 数据类型转换
  3. java redis 商品秒杀_使用redis秒杀出现产品超发现象求解?
  4. java为什么需要枚举_java – 什么是枚举,为什么它们有用?
  5. 计算机WIN7动态硬盘分区,win7硬盘分区教程
  6. 美好生活水果新食尚消费趋势报告
  7. 互联网日报 | 8月4日 星期三 | 京东货运航空筹建获批;小米手机出货量在欧洲首次登顶;阿里全球年度活跃消费者11.8亿...
  8. 中国共享经济发展报告
  9. 基本类型赋值和普通对象赋值的不同
  10. 【2017年第3期】面向共享的政府大数据质量标准化问题研究