URAL1049. Brave Balloonists
求约数的个数 质因子数的个数+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的更多相关文章
- ural 1049. Brave Balloonists(标准分解式,数论)
1049. Brave Balloonists Time limit: 2.0 secondMemory limit: 64 MB Ten mathematicians are flying on a ...
- HDU 1856 Brave Game(巴什博奕)
十年前读大学的时候,中国每年都要从国外引进一些电影大片,其中有一部电影就叫<勇敢者的游戏>(英文名称:Zathura),一直到现在,我依然对于电影中的部分电脑特技印象深刻. 今天,大家选择 ...
- HDU 1846 Brave Game(巴什博弈)
题目链接: 传送门 Brave Game Time Limit: 1000MS Memory Limit: 65536K 题目描述 各位勇敢者要玩的第一个游戏是什么呢?很简单,它是这样定义的: ...
- HDU 1846 Brave Game(简单巴什博弈)
Brave Game Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total ...
- 10055 - Hashmat the Brave Warrior
Problem A Hashmat the brave warrior Input: standard input Output: standard output Hashmat is a brave ...
- HDU-1846 Brave Game
http://acm.hdu.edu.cn/showproblem.php?pid=1846 (一)巴什博奕(Bash Game):只有一堆n个物品,两个人轮流从这堆物品中取物,规定每次至少取一个,最 ...
- HDOJ 1846 Brave Game
Problem Description 十年前读大学的时候,中国每年都要从国外引进一些电影大片,其中有一部电影就叫<勇敢者的游戏>(英文名称:Zathura),一直到现在,我依然对于电影中 ...
- Hashmat the brave warrior - UVa10055
欢迎访问我的新博客:http://www.milkcu.com/blog/ 原文地址:http://www.milkcu.com/blog/archives/uva10055.html 题目描述 Pr ...
- hdu 1846 Brave Game 简单博弈
Problem Description 十年前读大学的时候,中国每年都要从国外引进一些电影大片,其中有一部电影就叫<勇敢者的游戏>(英文名称:Zathura),一直到现在,我依然对于电影中 ...
随机推荐
- html之colspan && rowspan讲解
1.colspan && rowspan均在td标签中使用 2.每个单元格大小一致的前提 <table border="1" bordercolor=&quo ...
- VC5509的通用GEL代码
GEL是通用扩展语言(General Extension Language)的英文缩写,GEL是一个大小写敏感但缺少类型检测的解释性语言,只有int类型,在语法上可看作是C语言的一个子集.GEL主要用 ...
- Python中的元类和__metaclass__
1.什么是元类 元类让你来定义某些类是如何被创建的,从根本上说,赋予你如何创建类的控制权.可以把元类想成是一个类中类,或是一个类,它的实例是其它的类.当某个类调用type()函数时,你就会看到它到底是 ...
- css属性简写集合
作为一个前端攻城狮,CSS那绝对是基础,可是基础也有掌握不牢的时候.今天就来总结一下容易写错的CSS属性简写问题. 1.background 背景颜色:background-color ...
- 常用正则表达式(匹配URL/email/number)
var URL_REGEXP = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/ ...
- mysql if条件
#if表达式 SELECT reg_no, IF(reg_no='718170554','黄色宾利','红色宾利') FROM car WHERE reg_no IN ('718170554','12 ...
- POJ 2075
#include<iostream> #include<stdio.h> #include<string> #include<map> #include ...
- ELk 几篇好的文章
https://nxlog.co/docs/elasticsearch-kibana/using-nxlog-with-elasticsearch-and-kibana.html http://www ...
- ExtJs之Ext.util.TextMetrics
<!DOCTYPE html> <html> <head> <title>ExtJs</title> <meta http-equiv ...
- C#中对象的输出
假设有个Costmer类如下: class Costmer { public string Id { get; set; } public string City { get; set; } publ ...