题目链接:

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---因子数公式的更多相关文章

  1. HDUOJ---The number of divisors(约数) about Humble Numbers

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

  2. The number of divisors(约数) about Humble Numbers[HDU1492]

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

  3. 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 L ...

  5. 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 ...

  6. 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, ...

  7. hdu 1492(约数的个数)

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

  8. 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 ...

  9. hdu 5898 odd-even number 数位DP

    传送门:hdu 5898 odd-even number 思路:数位DP,套着数位DP的模板搞一发就可以了不过要注意前导0的处理,dp[pos][pre][status][ze] pos:当前处理的位 ...

随机推荐

  1. PIE SDK地图鼠标事件监听

    1.功能简介 地图鼠标事件包含鼠标的按下MouseDown(),弹起MouseUp(),移动MouseMove()等事件,通过这些事件可以对地图进行动态的操作,接下来以地图状态栏的信息为例具体介绍如何 ...

  2. PIE SDK矢量数据的读取

    1.功能简介 GIS将地理空间数据表示为矢量数据和栅格数据.矢量数据模型使用点.线和多边形来表示具有清晰空间位置和边界的空间要素,如控制点.河流和宗地等,每个要素被赋予一个ID,以便与其属性相关联.栅 ...

  3. Git本地缓存问题 修改密码后git无法拉取

    问题描述:使用正确的用户名和密码可以登录到Git代码仓库,但是在本地无法使用Git bash命令行的方式拉取代码. 问题原因:第一次使用Git bash方式拉取代码时,会根据当前的用户和密码生成一串. ...

  4. 2.4 GO Interface

    package itface type Sender interface { Send(url string) string } type Geter interface { Get(url stri ...

  5. MySQL主从复制,以及双机热备

    MySQL数据库自身提供的主从复制功能可以方便的实现数据的多处自动备份,实现数据库的拓展.多个数据备份不仅可以加强数据的安全性,通过实现读写分离还能进一步提升数据库的负载性能. 下图就描述了一个多个数 ...

  6. oracle 基础知识(九)----SQL解析

    一,解析过程 二,硬解析,软解析,软软解析 01,硬解析 将SQL语句通过监听器发送到Oracle时, 会触发一个Server process生成,来对该客户进程服务.Server process得到 ...

  7. 【程序员技术练级】学习一门脚本语言 python(三)跟数据库打交道

    接着上一篇,该篇讲述使用python对数据库进行基本的CRUD操作,这边以sqlite3为例子,进行说明.sqlite3 是一个非常轻型的数据库,安装和使用它是非常简单的,这边就不进行讲述了. 在py ...

  8. mysql limit查询(分页查询)探究

    MySQL的Limit子句 LIMIT offset,length Limit子句可以被用于强制 SELECT 语句返回指定的记录数.Limit接受一个或两个数字参数.参数必须是一个整数常量.如果给定 ...

  9. 自己用 python 实现 base64 编码

    自己用 python 实现 base64 编码 base64 编码原理 二进制文件中包含有很多无法显示和打印的字符,二进制的数据一般以 ASCII 码形式(8 bit,即一个字节)存储,8 bit 可 ...

  10. Pygame 加载音频

    Python Learning:Pygame 加载音频 Python 中自带的 winsound 模块 winsound 模块中 Beep 方法可以调用系统的蜂鸣器,接受一个为 frequency 的 ...