码迷,mamicode.com
首页 >  
搜索关键字:素数判定    ( 109个结果
1430 素数判定
1430 素数判定 1430 素数判定 时间限制: 1 s 空间限制: 1000 KB 1 #include<iostream> 2 #include<cstdio> 3 #include<cmath> 4 using namespace std; 5 int vis[30001]; 6 int m ...
分类:其他好文   时间:2017-04-21 20:43:40    阅读次数:162
1702 素数判定 2
1702 素数判定 2 1702 素数判定 2 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 钻石 Diamond 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 钻石 Diamond 时间限制: 1 s 时间限制: 1 s 空间限制: 128000 KB 空间 ...
分类:其他好文   时间:2017-04-21 16:50:40    阅读次数:245
codevs:2849 素数判定 3:输入一个正整数x(3<=x<=100000),判断x是否是质数,如果是质数则输出信息“prime”,否则输出“composite”。
#include<iostream>#include<cstdio>#include<cmath>using namespace std;int a[2];int main(){ int p,b=0,flag=1; scanf("%d",&p); for(int i=2;i<=p/2;i++) { ...
分类:其他好文   时间:2017-03-23 21:48:15    阅读次数:159
[SinGuLaRiTy] 米勒罗宾素数判定法
【SinGuLaRiTy-1003】 Copyright (c) SinGuLaRiTy 2017. All Rights Reserved. 背景 数论学家利用费马小定理研究出了多种素数测试办法,Miller-Rabbin 素数测试算法是其中较快的一种。 步骤 (1)计算奇数M,使得N=2^r * ...
分类:其他好文   时间:2017-03-20 20:50:28    阅读次数:206
【正常向】CODEVS上分黄金
白银上分黄金失败=。= 在之前有很认真的写了一波排序,所以排序并不是很怂,还是那个理,现阶段学习的都是比较简单的排序,都是所谓的冒泡排序啊,桶排序这类,至于插排和选择排序,再往后又是什么快拍就很尬了。 说一下今天A的题 1075 明明的随机数 1076 排序 1212 最大公约数 1430 素数判定 ...
分类:其他好文   时间:2017-03-19 10:58:11    阅读次数:183
复习基础素数
#include<iostream> #include<cstdio> #include<cmath> #define maxn 100009 using namespace std; typedef long long ll; int check_prime(int x)// 普通的素数判定 这里 ...
分类:其他好文   时间:2017-03-13 20:31:03    阅读次数:132
素数判定相关资料
素数(质数)的判定 (1)最基本素数判定方法大家熟悉,只用看看2到n(或n的平方根)之间有没有n的约数: #include void main() { int i,n; scanf("%d",&n); for(i=2;i int n,i,j,a[1000001],p[100000],t=0; voi... ...
分类:其他好文   时间:2017-01-14 18:17:40    阅读次数:274
素数判定
输入一个数,判断是不是素数 #include <iostream>#include <cmath>using namespace std;int main(){ int n,a; while(cin>>n) { a=0; if(n==2) { cout<<"is prime"<<endl; cont ...
分类:其他好文   时间:2017-01-12 08:51:13    阅读次数:123
题目1047:素数判定
题目1047:素数判定 时间限制:1 秒 内存限制:32 兆 特殊判题:否 题目描述: 给定一个数n,要求判断其是否为素数(0,1,负数都是非素数)。 输入: 测试数据有多组,每组输入一个数n。 输出: 对于每组输入,若是素数则输出yes,否则输入no。 样例输入: 13 样例输出: yes #in ...
分类:其他好文   时间:2016-08-05 15:13:51    阅读次数:151
<swustoj>?id=189 素数判定
链接http://acm.swust.edu.cn/problem/0189/ 素数http://baike.baidu.com/view/10626.htm?fromtitle=%E7%B4%A0%E6%95%B0&fromid=115069&type=syn 在一般领域,对正整数n,如果用2到 ...
分类:其他好文   时间:2016-07-30 13:27:09    阅读次数:185
109条   上一页 1 ... 3 4 5 6 7 ... 11 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!