POJ 2603
#include<iostream>
#include<stdio.h>
#define M 350000
#define N 30000
using namespace std; int boo[];
int prime[N];
void give_list();
int main()
{
memset(boo,,sizeof(int)*);
give_list();
//freopen("acm.acm","r",stdin);
int tem;
int sum;
int i;
int j;
int ans;
sum = ;
ans = ;
for(j = ; j < ; ++ j)
{
cin>>sum;
for(i = ; i < N; ++ i)
{ while(sum % prime[i] == )
{
++ boo[prime[i]];
sum /= prime[i];
if(sum == )
break;
}
if(sum == )
break;
}
}
ans = ;
for(i = ; i < ; ++ i)
{
if(boo[i])
ans *= ++boo[i];
}
cout<<ans%<<endl;
system("pause");
} void give_list()
{
bool prime_1[M];
int i;
int j;
memset(prime_1,true,sizeof(bool)*M);
prime_1[] = false;
for(i = ; i < M; ++ i)
{
if(prime_1[i])
{
j = i * ;
while(j < M)
{
prime_1[j] = false;
j = j + i;
}
}
}
j = ;
for(i = ; i < M; ++ i)
{
if(prime_1[i])
{
prime[j] = i;
++ j;
}
}
}
POJ 2603的更多相关文章
- POJ 3370. Halloween treats 抽屉原理 / 鸽巢原理
Halloween treats Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 7644 Accepted: 2798 ...
- POJ 2356. Find a multiple 抽屉原理 / 鸽巢原理
Find a multiple Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7192 Accepted: 3138 ...
- POJ 2965. The Pilots Brothers' refrigerator 枚举or爆搜or分治
The Pilots Brothers' refrigerator Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 22286 ...
- POJ 1753. Flip Game 枚举or爆搜+位压缩,或者高斯消元法
Flip Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 37427 Accepted: 16288 Descr ...
- POJ 3254. Corn Fields 状态压缩DP (入门级)
Corn Fields Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 9806 Accepted: 5185 Descr ...
- POJ 2739. Sum of Consecutive Prime Numbers
Sum of Consecutive Prime Numbers Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 20050 ...
- POJ 2255. Tree Recovery
Tree Recovery Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11939 Accepted: 7493 De ...
- POJ 2752 Seek the Name, Seek the Fame [kmp]
Seek the Name, Seek the Fame Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 17898 Ac ...
- poj 2352 Stars 数星星 详解
题目: poj 2352 Stars 数星星 题意:已知n个星星的坐标.每个星星都有一个等级,数值等于坐标系内纵坐标和横坐标皆不大于它的星星的个数.星星的坐标按照纵坐标从小到大的顺序给出,纵坐标相同时 ...
随机推荐
- c# 动态数组-----“动态”数组
其实在大多数工作中我们能通过前处理来确定我们的数组有多大,这样我们就可以声明相应大小的数组了.我感觉这种“动态”数组就够我用了.比如我要处理excel中数据,数据有m行*n列,这样我就可以通过读取ex ...
- poj 2299 Ultra-QuickSort(归并排序,树状数组,线段树)
Description In this problem, you have to analyze a particular sorting algorithm. The algorithm proce ...
- Windows窗口消息大全
////////////////////////////////////////////////////////////////////////// #include "AFXPRIV.H& ...
- Mapnik
Downloads Latest Release The latest release is Mapnik v3.0.22.最新版本是Mapnik v3.0.22. Mapnik 3.0.22 Rel ...
- centos网络配置(手动设置,自动获取)的2种方法3
不知道为什么最近一段时间网络特别的慢,还老是断,断的时候,局域网都连不上,当我手动设置一下ip后就可以了,搞得我很无语.下面是2种设置网络连接的方法,在说怎么设置前,一定要做好备份工作,特别是对于新手 ...
- html部分常用标签的含义及作用
1.a 超链接 <a> 标签定义超链接,用于从一张页面链接到另一张页面.<a> 标签中必须提供 href 属性或 name 属性,它指示链接的目标. 例如:点击 百度一下 跳转 ...
- html5之range
第一次以这种方式做笔记,希望可以加强自己对新知识的理解,更希望能得到更多朋友的指正. 言归正传: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 ...
- set_error_handler
set_error_handler这个函数的作用是为了防止错误路径泄露 何为错误路径泄露呢? 我们写程序,难免会有问题,而PHP遇到错误时,就会给出出错脚本的位置.行数和原因 有很多人说,这并没有什么 ...
- linux 三剑客之awk
#AWK命令 基础显示 打印install.log文件中包含data字段行的第二区域 awk '/data/ {print $2}' install.log 查看num10.txt的第一行 head ...
- Azure DevOps Server 2019 (TFS)安装教程
概述 Azure DevOps Server 2019 (之前的名称为TFS),作为微软Azure DevOps 的企业私有(on-premises)服务器,是一个为开发团队提供软件协作开发管理的服务 ...