URAL1352. Mersenne Primes
梅森素数 打表
搜梅森素数的时候 看到一句话 欧拉在双目失明的情况下 用心算出了2的31次方-1是素数 他用心算的。。。
#include <iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<stdlib.h>
#include<cmath>
using namespace std;
#define N 1000010
int p[]={,,,,,,,,,,,,
,,,,,,,,,,
,,,,,,,,
,,,,,,,};
int main()
{
int t,n;
cin>>t;
while(t--)
{
cin>>n;
cout<<p[n-]<<endl;
}
return ;
}
URAL1352. Mersenne Primes的更多相关文章
- ural 1352. Mersenne Primes
1352. Mersenne Primes Time limit: 1.0 secondMemory limit: 64 MB Definition. If the number 2N−1 is pr ...
- Project Euler 97 :Large non-Mersenne prime 非梅森大素数
Large non-Mersenne prime The first known prime found to exceed one million digits was discovered in ...
- Effective Java 第三版——45. 明智审慎地使用Stream
Tips <Effective Java, Third Edition>一书英文版已经出版,这本书的第二版想必很多人都读过,号称Java四大名著之一,不过第二版2009年出版,到现在已经将 ...
- Effective Java 第三版——48. 谨慎使用流并行
Tips <Effective Java, Third Edition>一书英文版已经出版,这本书的第二版想必很多人都读过,号称Java四大名著之一,不过第二版2009年出版,到现在已经将 ...
- Codeforces225E - Unsolvable
Portal Description 求所有对于方程\[z=\left \lfloor \frac{x}{2} \right \rfloor+y+xy\]不存在正整数解\((x,y)\)的\(z\)中 ...
- UVA 583 分解质因数
Webster defines prime as:prime (prim) n. [ME, fr. MF, fem. of prin first, L primus; akin to L prior] ...
- [Java读书笔记] Effective Java(Third Edition) 第 7 章 Lambda和Stream
在Java 8中,添加了函数式接口(functional interface),Lambda表达式和方法引用(method reference),使得创建函数对象(function object)变得 ...
- sicily 1009. Mersenne Composite N
Description One of the world-wide cooperative computing tasks is the "Grand Internet Mersenne P ...
- [LeetCode] Count Primes 质数的个数
Description: Count the number of prime numbers less than a non-negative number, n click to show more ...
随机推荐
- shiro添加注解@RequiresPermissions不起作用
这是因为没有开启spring拦截器,在spring-mvc.xml中加入以下代码就可以了(一定要写在最先加载的xml中,写在后面加载的xml中也不起作用) <bean class="o ...
- [百度空间] [原] 全局operator delete重载到DLL
由于很久没有搞内存管理了,很多细节都忘记了今天项目要用到operator delete重载到DLL,发现了问题,网上搜索以后,再对比以前写的代码,发现了问题:原来MSVC默认的operator new ...
- 使用css3伪元素制作时间轴并且实现鼠标选中高亮效果
利用css3来制作时间轴的知识要点:伪元素,以及如何在伪元素上添加锚伪类 1)::before 在元素之前添加内容. 2)::after 在元素之后添加内容. 提示:亦可写成 :before :aft ...
- Sublime搭建nodejs环境(windows)
1.下载nodejs,并安装ok后,配置好环境变量. 2.下载sublime text3 3.在package install 包中新增node插件(或者直接去SublimeText-Nodejs插件 ...
- 使用eclipse maven遇到的错误(转)
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources (defaul ...
- O2O模式成功案例分享 汲取精华化为己用
本文通过分享一些公司的o2o成功案例让您了解什么是O2O,o2o的优势,o2o模式有哪些,未来我们要如何做o2o才更有竞争力,学牛人的o2o创新玩法,摸索适合自己的o2o思路.拥抱o2o - 传统企业 ...
- Sqli-labs less 64
Less-64 此处的sql语句为 $sql="SELECT * FROM security.users WHERE id=(($id)) LIMIT 0,1"; 示例payloa ...
- POJ 1274
#include<iostream> #include<stdio.h> #include <string.h> #include <vector> # ...
- css系列-间隔与间距实例
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- App接口设计1
http://blog.csdn.net/newjueqi/article/details/44062849 http://www.tuicool.com/articles/YNZBna http:/ ...