博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
HDU1492 The number of divisors(约数) about Humble Numbers【约数】
阅读量:6910 次
发布时间:2019-06-27

本文共 1364 字,大约阅读时间需要 4 分钟。

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 4105    Accepted Submission(s): 2012
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

问题链接:。

问题简述:参见上文

问题分析

计算谦虚数的约数数量问题。

根据题意,1是谦虚数;谦虚数是2,3,5和7的倍数;最小的谦虚数乘以2,3,5和7是谦虚数。

需要注意的是,谦虚数约数个数是2,3,5和7的指数的乘积。

程序说明
(略)

参考链接:(略)

题记(略)

AC的C++语言程序如下:

/* HDU1492 The number of divisors(约数) about Humble Numbers */#include 
#include
using namespace std;const int N = 4;int divisors[N] = {2, 3, 5, 7};int main(){ long long n; while(scanf("%lld", &n) != EOF && n) { long long ans = 1; for(int i=0; i

转载于:https://www.cnblogs.com/tigerisland/p/7563680.html

你可能感兴趣的文章
基于Http原理实现Android的图片上传和表单提交
查看>>
解读大数据世界中MapReduce的前世今生
查看>>
【转】TCP为什么是个可靠的协议
查看>>
Word组件Spire.Doc6.0.52 发布| 修复转PDF文本重叠的问题
查看>>
我的友情链接
查看>>
程序员是吃青春饭的?
查看>>
错误:docker-ce conflicts with 2:docker-1.13.1-74.git
查看>>
JDK并发包之LinkedBlockingQueue
查看>>
响应式设计(Response Web Design)实践
查看>>
喜迎2015年新年:坦克大战(Robocode)游戏编程比赛图文总结
查看>>
ASP.NET MVC 5 - 给数据模型添加校验器
查看>>
矩表 - 现代数据分析中必不可少的报表工具
查看>>
Ansible 一键配置安装Keepalived+Nginx作为前端,httpd+php作为后端
查看>>
服务器维护安全策略方案
查看>>
maven-assembly-plugin 的includeBaseDirectory研究
查看>>
SSL证书相关技巧 -- 如何访问一个网站,其证书不在系统证书列表中
查看>>
我的友情链接
查看>>
我的友情链接
查看>>
【hadoop】17.MapReduce-wordcount案例
查看>>
MyBatis标签
查看>>