The number of divisors(约数) about Humble Numbers

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1741    Accepted Submission(s): 852
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 <iostream>
#include <map>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <algorithm>
using namespace std;
int main()
{__int64 n;__int64 rc[4];int p[4]={2,3,5,7};while(scanf("%I64d",&n),n){for(int i=0;i<4;i++){rc[i]=1;if(n%p[i]==0)while(n%p[i]==0) {n/=p[i];rc[i]++;}}printf("%I64d\n",rc[0]*rc[1]*rc[2]*rc[3]);}return 0;
}

转载于:https://www.cnblogs.com/372465774y/archive/2012/10/20/2732386.html

HDU 1492 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. 杭电1492 The number of divisors(约数) about Humble Numbers

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

  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. 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. HDU 3826 Squarefree number:题目解答源码

    2019独角兽企业重金招聘Python工程师标准>>> HDU 3826 Squarefree number:题目解答源码 In mathematics,a squarefree n ...

  7. 【HDU】1005 Number Sequence (有点可爱)

    http://acm.hdu.edu.cn/showproblem.php?pid=1005 A number sequence is defined as follows: f(1) = 1, f( ...

  8. HDU 5972 Regular Number

    Regular Number http://acm.hdu.edu.cn/showproblem.php?pid=5972 题意: 给定一个字符串,求多少子串满足,子串的第i位,只能是给定的数(小于等 ...

  9. HDU 5898 odd-even number

    题目:odd-even number 链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=5898 题意:给一个条件,问l 到r 之间有多少满足条件的 ...

最新文章

  1. 程序员加班崩溃,过路外卖小哥主动帮忙改代码,网友直呼太暖了!
  2. 用Beamer制作幻灯片(卷三 动画篇)
  3. 系列TCP/IP协议-广播与多播(010)
  4. 补第一阶段冲刺站立会议3(应发表日期5月15日)
  5. 东师计算机应用基础18秋在线作业3答案,奥鹏东师计算机应用基础15秋在线作业3试卷及答案(4)...
  6. 瞎说系列之Object.assign入门
  7. OCM备考 三. Managing Database Availability 之RMAN高级操作
  8. (转帖)开源容器集群管理系统Kubernetes架构及组件介绍
  9. js读写php文件,在js中如何读取本地文件
  10. 注解@RequestParam【不添加默认项注解】与@RequestBody的使用场景
  11. Java例15.13——使用MVC结构计算三角形面积
  12. Postman代理设置
  13. 学习笔记-Wood‘s anomalies
  14. Teams通话质量仪表盘进阶使用
  15. SOLID原则 【转】
  16. 同步通信和异步通信的爱恨情仇
  17. 原理 + 代码 | Python 实现多元线性回归模型 (建模 + 优化,附源数据)
  18. Python3爬取企查查网站的企业年表并存入MySQL
  19. 对比:空洞卷积与转置卷积(吉米王)
  20. 逻辑推理题:谁是凶手

热门文章

  1. 进程控制常用的一些操作
  2. WordPress插件开发-创建、停用、删除插件
  3. 学习笔记(11月08日)--异常
  4. 在OOW2009上寻宝撞大运续(床上篇)
  5. 程序员,软件测试知多少?
  6. SpringMVC(一):环境搭建
  7. 转:[C/C++]2014年7月华为校招机试真题(一)
  8. Android应用开发—Android 消息处理机制:HandlerMessage
  9. matlab采样频谱,Matlab对采样数据进行频谱分析
  10. flask-SQLAlchemy 使用 session.commit() 处理异常回滚