E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
primes
StandardEvaluationContext用法
List<Integer>
primes
= new ArrayList<Integer>();
primes
.addAll(Arrays.asList(2,3,5,7,11,13,17
rayln
·
2011-10-18 20:00
context
pat-1015 Reversible
Primes
将数字转成指定进制,再反序,判断原数和新数是否都是质数。 注意质数判断时要有等号,如25的平方根5,注意0和1的特判。 本题中,进制转换和反序可以一次完成。 #include<iostream> using namespace std; #include<math.h> bool isPrime(int n) { if(n==1||n=
linest
·
2011-09-28 20:00
Prim
UVa 10168 Summation of Four
Primes
UVa10168SummationofFourPrimes如果N为奇数,那么前两个素数为2和3;如果N为偶数,那么前两个素数为2和2。这样一来转化成了将一个偶数分解成两个素数的和。以下是我的代码:#include using namespace std;const int kMaxn = 10000000;int cnt,Prime[680000];bool isNotPrime[ kMaxn +
心如止水
·
2011-09-06 23:00
Problem 50
问题描述: The prime 41, can be written as the sum of six consecutive
primes
: 41 = 2 + 3 + 5 +
to_zoe_yang
·
2011-09-03 14:00
em
HDU-2161
Primes
这里主要预习了素数筛选以及输入外挂的编写。涛神的筛选法一直记着,给力。 #include <cstdio>#include <cstring>#include <cstdlib>using namespace std;char hash[16005] = {0};bool getint( int &t ){ char c; int
·
2011-08-29 21:00
Prim
Problem 35
There are thirteen such
primes
below 100: 2, 3, 5, 7, 11, 13, 17, 31,
to_zoe_yang
·
2011-08-17 15:00
em
POJ3292-Semi-prime H-numbers
如果一个H-number是H-
primes
当且仅当它的因数只有1和它本身(除1外)。一个H-number是H-semi-prime当且仅当它只由两个H-
primes
的乘积表示。
lyy289065406
·
2011-07-31 16:00
table
[置顶] 普通筛素数及线性筛素数
这也是理解代码中if(i%
primes
[j]==0)break;的关键例如
leolin_
·
2011-07-28 20:00
Problem 10
问题描述: The sum of the
primes
below 10 is 2 + 3 + 5 + 7 = 17.
to_zoe_yang
·
2011-06-13 21:00
em
UVa Problem 10168 Summation of Four
Primes
(四素数之和)
//SummationofFourPrimes(四素数之和) //PC/UVaIDs:110705/10168,Popularity:A,Successrate:averageLevel:2 //Verdict:Accepted //SubmissionDate:2011-06-11 //UVaRunTime:0.128s // //版权所有(C)2011,邱秋。metaphysis#yeahdo
metaphysis
·
2011-06-11 21:00
c
Date
summation of four
primes
//SummationofFourPrimes.cpp:Definestheentrypointfortheconsoleapplication.//#include"stdafx.h"#include#include#includeusingnamespacestd;boolIsPrime(intx){inty=(int)sqrt(x*1.0);for(inti=2;iPrimes;intn;i
Hilda_Chen
·
2011-03-10 18:00
Eratosthenes筛法--Haskell实现
primes
=sieve[2..]wheresieve(x:l)=x:sieve[y|y0]
primes
'=2:sieve[3,5..]wheresieve(x:l)=x:sieve[y|y=x*xthenmodyx
mathsoperator
·
2011-03-06 17:00
USACO 4.3.2 The
Primes
( 筛法求素数, 搜索)
USACO4.3.2ThePrimes(筛法求素数,搜索)做了一天.AC的速度还可以, 时间最长的0.16s.1.开始做之前,要确定下搜索顺序,这个很关键. 参考http://starforever.blog.hexun.com/2319991_d.html2.首先用筛法求出10000-99999的所有素数,然后对素数进行分类:5位数中,分成第一位是
小阮的菜田
·
2011-01-29 00:00
POJ 3132 Sum of Different
Primes
动态规划 DP 0-1背包问题
http://poj.org/problem?id=3132 题意就是要求一个数可以分解成指定数个素数的和的种数方法是参考网上的大牛的做法,学习了! SumofDifferentPrimesTimeLimit: 5000MS MemoryLimit: 65536KDescriptionApositiveintegermaybeexpressedasasumofdifferentprimenumbe
yming0221
·
2011-01-23 19:00
POJ 3132 Sum of Different
Primes
动态规划 DP 0-1背包问题
Sum of Different
Primes
Time Limit:5000MS Memory Limit:65536K Description A
soboer
·
2011-01-23 19:00
动态规划
POJ 3132 Sum of Different
Primes
动态规划 DP 0-1背包问题
Sum of Different
Primes
Time Limit:5000MS Memory Limit:65536K Description A
thecloud
·
2011-01-23 19:00
动态规划
POJ 2739 素数筛选
POJ2739 关键是找10000内质数的方法#include usingnamespacestd; voidcreate_
primes
(int*prime,int&size){ //找出10000以内所有的质数
yangliuy
·
2010-11-13 17:00
网上收集的GIF操作的三个类AnimatedGifEncoder,NeuQuant,LZWE(二)
protected static final int netsize = 256; /* number of colours used */ /* four
primes
louis_cuti
·
2010-10-29 10:00
F#
J#
仿照标准库做了个hashmap!不容易啊。
. // #include "stdafx.h" #include <iostream> #include <string> const int
primes
daojin
·
2010-10-25 03:00
HashMap
素数的打印问题_GCC_VS2005
打印指定数字范围内的素数,程序如下: 1 #include<stdio.h> 2 void find_
primes
AllenNewOk
·
2010-09-03 19:00
qq
ubuntu
XP
gcc
J#
POJ3132Sum of Different
Primes
题解动态规划DP
65536KTotalSubmissions:2160 Accepted:1334DescriptionApositiveintegermaybeexpressedasasumofdifferentprimenumbers(
primes
power721
·
2010-08-12 19:00
Integer
express
input
dataset
output
Numbers
在JSP中设置HTTP应答头
另外还要用到:PrimeList.java,用于在后台线程中创建一个素数的Vector;
Primes
.java,用于随机生成BigInteger类型的大数字,检查它们是否是素数。
Joy.zhang
·
2010-07-14 17:00
java
html
jsp
servlet
The beginning of C#, sieve the
primes
!
/* *ATestofC# *UseOddsievetocountorprintthePrimes. *T23701.73G,2GRam,10^8use2.8s *winxos2010-3-5 */ usingSystem; namespaceConsoleApplication1 { classTest { staticvoidMain() { Console.Writ
winxos
·
2010-06-12 09:51
C#
职场
休闲
sieve
Beginning
primes
The beginning of C#, sieve the
primes
!
/* *ATestofC# *UseOddsievetocountorprintthePrimes. *T23701.73G,2GRam,10^8use2.8s *winxos2010-3-5 */ usingSystem; namespaceConsoleApplication1 { classTest { staticvoidMain() { Console.Writ
winxos
·
2010-06-12 09:51
C#
职场
休闲
sieve
Beginning
primes
埃拉托色尼计算素数序列
public class
Primes
{ public static void main(String[] args) { int N = 25; boolean[] a = new
jimmee
·
2010-03-04 22:00
J#
埃拉托色尼计算素数序列
public class
Primes
{ public static void main(String[] args) { int N = 25; boolean[] a = new
jimmee
·
2010-03-04 22:00
J#
总结
当遵循以上全部建议后,实例代码的最终并行区域为:#pragmaompparallelforschedule(dynamic,100)reduction(+:number_of_
primes
,number_of
wanglei5695312
·
2009-11-19 19:00
工具
float
任务
英特尔
parallel
Project Euler 第35题:
There are thirteen such
primes
below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 7
lampeter123
·
2009-08-14 09:00
project
求素数的快速算法(python)
def
primes
(n): """ returns a list of prime numbers from 2 to < n """
lampeter123
·
2009-08-10 12:00
算法
python
J#
刚刚上课两天,记录点小代码(求素数的)
include#includestruct PrimeBlock{ PrimeBlock(); void addPrime(int ); bool isFull(); int
primes
把握命运,追逐梦想
·
2009-07-28 16:00
Project Euler 第27题
remarkable quadratic formula: n² + n + 41 It turns out that the formula will produce 40
primes
lampeter123
·
2009-07-10 11:00
project
Eratosthens sieve
lt;set> using namespace std; #include "IO.hpp" void SIEVE(set<int>&
primes
Dustman
·
2009-05-31 02:00
C++
c
C#
The
Primes
(USACO)
1 import java.io.*; 2 import java.util.*; 3 /* 4 ID: yanglei4 5 LANG: JAVA 6 TASK:prime3 7 */ 8 public class prime3{ 9 static boolean[] prime = new boolean[100001]; 10 static int[] d
无界
·
2009-04-24 12:00
hdu 1239 Calling Extraterrestrial Intelligence Again
includeusing namespace std;int prim[1230];//10000以内的素数共1229个int main(){ int i,j,k;//k记录10000以内素数的个数 bool
primes
Dreams
·
2009-04-11 19:00
USACO 4.3.2 The
Primes
一道相当BT的搜索题,写了300+行数。更BT的是前前后后写了五六遍,几种搜索策略都离通过最后两个点差之毫厘,最终还是加了剪枝才过的。一道题写了1K行以上的代码量,也算是罕古未见了!此题首先要明确搜索顺序。限制条件最多的是第五行和第五列,然后对角线也可以控制较多行列,之后是第一行和第一列,最后减法得到剩下四个数,判断即可。但是这样仍然过不了237这样的数据。于是加入剪枝:在搜索完第五行第五列的同时
冗余的代码
·
2009-03-08 11:00
pyrex学习笔记
easy_install pyrex 1.写pyrex文件 ~/pyrex $ ls __init__.py
primes
.pyx ~/pyrex $ cat
primes
.pyx
zuroc
·
2009-02-24 03:00
C++
c
python
C#
gcc
Get prime numbers nearby a number less than 10^10
nearby it by the following codes: Private Sub Command1_Click() Debug.Print
primes
10000
eimhee
·
2008-12-28 20:00
J#
Project Euler解题汇总 051 ~ 060
51: Find the smallest prime which, by changing the same part of the number, can form eight different
primes
Eastsun
·
2008-09-12 22:00
C++
c
PHP
.net
scala
筛法求素数
按字典顺序生成所有的排列 /** &#Util.scala utils for mathematical algorithm,include: # get all
primes
Eastsun
·
2008-09-10 21:00
.net
scala
筛法求素数+分解质因子+欧拉函数+求约数
bool prime[31700]; // 31700*31700 > 1000000000int
primes
[3500];intcnt=0; //筛法求素数void sieve()...{
touzani
·
2007-08-26 21:00
vector
pair
算法教程---Mathematics for TopCoders
touzaniMathematicsandcomputerscienceoftengohandinhand.Thisarticlediscussesthetheoryandpracticalapplicationtosomeofthemorecommonmathematicalconstructs.Thetopicscoveredare:
primes
winark
·
2007-05-25 16:00
Algorithm
算法
Integer
less
optimization
Numbers
算法教程---Mathematics for TopCoders
touzaniMathematicsandcomputerscienceoftengohandinhand.Thisarticlediscussesthetheoryandpracticalapplicationtosomeofthemorecommonmathematicalconstructs.Thetopicscoveredare:
primes
touzani
·
2007-05-25 00:00
java
Algorithm
算法
Integer
optimization
Numbers
PKU3121 Sum of Different
Primes
65536KTotalSubmit:362Accepted:219DescriptionApositiveintegermaybeexpressedasasumofdifferentprimenumbers(
primes
oyjpArt ACM/ICPC算法程序设计空间
·
2007-02-18 10:00
写段代码验证哥德巴赫猜想之二:验证(附:关于下标值应该定义为有符号数)。
昨天在写
Primes
的时候,把下标值定义成无符号整型(size_t),结果在一次反向for循环(循环变量从大递减到小)中出现错误:for(size_ti=0;i=0;--j)第一行的循环可以正确运行,但第二行的循环将会出错
SeaWave
·
2006-02-09 21:00
Integer
Class
Delphi
写段代码验证哥德巴赫猜想之一:求给定范围的素数。
按上述思路编制的
Primes
类如下,可做为“验证哥德巴赫猜想”的辅助类(因为这个需求,所以该类的generate()方
SeaWave
·
2006-02-08 23:00
算法
vector
面试
OS
Flash
Class
上一页
8
9
10
11
12
13
14
15
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他