1049

求约数的个数 质因子数的个数+1相乘

 #include <iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<stdlib.h>
#include<cmath>
using namespace std;
#define N 10000
int f[N+],a[],p[N+],g,o[N+];
void init()
{
int i,j;
for(i = ; i <= ; i++)
if(!f[i])
{
for(j = i+i ; j <= N ; j+=i)
f[j] = ;
}
for( i = ; i <= N ;i++)
if(!f[i])
p[++g] = i;
}
int main()
{
int i,j;
init();
for(i = ; i <= ; i++)
cin>>a[i];
for(i = ; i <= ; i++)
{
int x = a[i];
for(j = ; j <= g ; j++)
{
while(x&&x%p[j]==)
{
x/=p[j];
o[p[j]]++;
}
}
}
int ans = ;
for(i = ; i <= g ; i++)
ans = (ans*(o[p[i]]+))%;
cout<<ans<<endl;
return ;
}

URAL1049. Brave Balloonists的更多相关文章

  1. ural 1049. Brave Balloonists(标准分解式,数论)

    1049. Brave Balloonists Time limit: 2.0 secondMemory limit: 64 MB Ten mathematicians are flying on a ...

  2. HDU 1856 Brave Game(巴什博奕)

    十年前读大学的时候,中国每年都要从国外引进一些电影大片,其中有一部电影就叫<勇敢者的游戏>(英文名称:Zathura),一直到现在,我依然对于电影中的部分电脑特技印象深刻. 今天,大家选择 ...

  3. HDU 1846 Brave Game(巴什博弈)

    题目链接: 传送门 Brave Game Time Limit: 1000MS     Memory Limit: 65536K 题目描述 各位勇敢者要玩的第一个游戏是什么呢?很简单,它是这样定义的: ...

  4. HDU 1846 Brave Game(简单巴什博弈)

    Brave Game Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total ...

  5. 10055 - Hashmat the Brave Warrior

    Problem A Hashmat the brave warrior Input: standard input Output: standard output Hashmat is a brave ...

  6. HDU-1846 Brave Game

    http://acm.hdu.edu.cn/showproblem.php?pid=1846 (一)巴什博奕(Bash Game):只有一堆n个物品,两个人轮流从这堆物品中取物,规定每次至少取一个,最 ...

  7. HDOJ 1846 Brave Game

    Problem Description 十年前读大学的时候,中国每年都要从国外引进一些电影大片,其中有一部电影就叫<勇敢者的游戏>(英文名称:Zathura),一直到现在,我依然对于电影中 ...

  8. Hashmat the brave warrior - UVa10055

    欢迎访问我的新博客:http://www.milkcu.com/blog/ 原文地址:http://www.milkcu.com/blog/archives/uva10055.html 题目描述 Pr ...

  9. hdu 1846 Brave Game 简单博弈

    Problem Description 十年前读大学的时候,中国每年都要从国外引进一些电影大片,其中有一部电影就叫<勇敢者的游戏>(英文名称:Zathura),一直到现在,我依然对于电影中 ...

随机推荐

  1. share干什么的

    share到底干什么的 //--------------------打开GameServer,share中加载------------------------- .加载nBodyID //玩家的nBo ...

  2. 父页面 调用iframe方法

      父页面调用Iframe的方法 document.getElementById("tabIf0").contentWindow.Search();     Jquery 方式: ...

  3. 如何将控制台程序包装成windows服务

    1. 新建一个项目,或者从选择当前解决方案--右键-添加--新建项目 2. 选择(项目类型)Visual C#项目,(模板)Windows 服务,填写要创建的服务名称(修改默认的WindowServi ...

  4. sql server 时间

    sql server 获取月份天数:1,SELECT 32-DAY(CAST('2015-03-01' as datetime)+32-DAY(CAST('2015-03-01' as datetim ...

  5. NGUI 自定义 Drag Item Script

    最近要实现一个NGUI效果. 查看了一下,NGUI有个自带 UIDragDropItem.cs 的组件进过修改后即可以实现. 下面贴上UI布局,代码: mDragDropItem.cs using U ...

  6. firefox浏览器live http headers无法使用

    手贱的将firefox升级后,很多的插件不能使用.我这里因为用到live http headers,所以以此为例子.主要表现为live http headers修改数据包后,尤其是post数据包后,r ...

  7. BZOJ2463: [中山市选2009]谁能赢呢?

    感慨下汉堡的找水题能力… /************************************************************** Problem: 2463 User: zhu ...

  8. this的使用、继承、super

    1.this的使用 1)可以用于区分局部变量 Person(int age,string name) { this.age=age; this.name=name; } 2)构造方法中,用this调用 ...

  9. Grid分组汇总

    Ext.onReady(function () {                Ext.define('personInfo', {                    extend: 'Ext. ...

  10. JavaScript文件应该放在网页的什么位置

    JavaScript文件应该放在网页的什么位置 http://www.lihuai.net/qianduan/js/352.html 在<良好的JavaScript编程习惯>系列教程的第三 ...