hdu-1492 The number of divisors(约数) about Humble Numbers---因子数公式
题目链接:
http://acm.hdu.edu.cn/showproblem.php?pid=1492
题目大意:
给出一个数,因子只有2 3 5 7,求这个数的因子个数
解题思路:

直接求出指数即可
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
#include<stack>
#include<map>
#include<sstream>
#define Mem(a, b) memset(a, b, sizeof(a))
using namespace std;
typedef long long ll;
const int INF = 1e9 + ;
const int maxn = +;
int a[] = {,,,};
int b[];
ll n;
int main()
{
while(scanf("%lld", &n) != EOF && n)
{
Mem(b, );
for(int i = ; i < ; i++)
{
if(n % a[i] == )
{
while(n % a[i] == )
{
b[i]++;
n /= a[i];
}
}
}
ll ans = ;
for(int i = ; i < ; i++)
{
ans *= (b[i] + );
}
printf("%lld\n", ans);
}
return ;
}
hdu-1492 The number of divisors(约数) about Humble Numbers---因子数公式的更多相关文章
- HDUOJ---The number of divisors(约数) about Humble Numbers
The number of divisors(约数) about Humble Numbers Time Limit: 2000/1000 MS (Java/Others) Memory Lim ...
- The number of divisors(约数) about Humble Numbers[HDU1492]
The number of divisors(约数) about Humble Numbers Time Limit: 2000/1000 MS (Java/Others) Memory Lim ...
- 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 ...
- 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 Time Limit: 2000/1000 MS (Java/Others) Memory Lim ...
- HDU - 1711 A - Number Sequence(kmp
HDU - 1711 A - Number Sequence Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1 ...
- hdu 5898 odd-even number 数位DP
传送门:hdu 5898 odd-even number 思路:数位DP,套着数位DP的模板搞一发就可以了不过要注意前导0的处理,dp[pos][pre][status][ze] pos:当前处理的位 ...
随机推荐
- 2019.03.26 读书笔记 关于 invoke与begininvoke
invoke与begininvoke是同步委托和异步委托,但是有两种使用情况: 1. control中的invoke.begininvoke. 2. delegrate中的invoke.beginin ...
- (转)远程SSH连接服务与基本排错
远程SSH连接服务与基本排错 原文:https://www.cnblogs.com/chensiqiqi/p/6224474.html#top 1.1 为什么要远程连接Linux系统 在实际的工作场景 ...
- 【问题记录】 Linux 安装 apache 遇到的一些问题
以下为linux上安装apache时自己遇到的一些问题,记录在这,以后遇到时也会不定时更新... 一.安装Apache提示APR not found的解决办法 解决方法: 1. 网站 http://a ...
- jquery点击事件后增加克隆的标签,并改变克隆的属性加入
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- 【Linux相识相知】bash的特性
命令历史 shell进程会记录用户提交执行过的命令 可以是用history查看: [root@localhost dev]# history ss -tnl ifconfig vi /etc/sysc ...
- 我们能用canvas做什么?
什么是Canvas? Canvas元素是HTML5的一部分,允许脚本语言动态渲染位图像.Canvas由一个可绘制地区HTML代码中的属性定义决定高度和宽度.JavaScript代码可以访问该地区,通过 ...
- 跨页面传值2之cookie多值使用
单值cookie结构 CookieKeyName——CookieValue CookieKeyName2——CookieValue2 ............... 通过CookieKeyName进行 ...
- 文件读取工具类读取properties文件
1.创建工具类 import java.io.IOException; import java.util.Properties; /** * * 类名称:PropertiesUtil * 类描述: 文 ...
- Html-知识总结
1.Html概述 1.1什么是Html Html:超文本标记语言(hyperText Markup Language) “超文本”加上指页面内可以包含图片,链接等非文字内容. “标记”就是使用标签的方 ...
- Java 匿名内部类 & 内部类
一.JAVA中内部类和匿名内部类的区别 内部类:内部类可以是static的或者非static的,static内部类只能包含静态方法和静态类变量,只能访问外部类的静态元素,内部类可以实例化,多次使用. ...