The set of ribs denoted by 7331 is prime; the three ribs 733 are prime; the two ribs 73 are prime, and, of course, the last rib, 7, is prime. The nu.....
分类:
其他好文 时间:
2015-05-25 21:54:52
阅读次数:
96
这篇文章主要将要介绍JUnit测试工具的使用。本文中待测试的对象为一个简单的Calculate类,包括加(add),减(substract),乘(multiply),除(divide)四个简单的方法。 1 public class Calculate { 2 3 public st...
分类:
其他好文 时间:
2015-05-25 21:50:13
阅读次数:
165
Description:Count the number of prime numbers less than a non-negative number, n.思路分析:这题是一道数学题,求小于n的所有质数。容易想到的思路是定义个isPrime的判定函数,对小于n的数一个一个判定,但是时间复杂度O(N^2)。有没有更快的算法呢?有,这是一个经典的找质数的算法,Sieve of Eratosthe...
分类:
其他好文 时间:
2015-05-25 16:47:52
阅读次数:
128
Change interatomic distance and Run DFT (Density Functional Theory, deMon2k code):#! /bin/bashfor n in `head -n 1 ../distances` do molecule=${1%....
分类:
其他好文 时间:
2015-05-25 16:12:45
阅读次数:
97
题目如下:
A reversible prime in any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a reversible prime because its reverse 37 is al...
分类:
其他好文 时间:
2015-05-25 14:39:05
阅读次数:
140
Sum of Consecutive Prime Numbers
Description
Some positive integers can be represented by a sum of one or more consecutive prime numbers. How many such representations does a given positive integer have? For example, the integer 53 has two representation...
分类:
其他好文 时间:
2015-05-25 14:37:58
阅读次数:
127
Prime Distance
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 13459
Accepted: 3578
Description
The branch of mathematics called number theory is about prope...
分类:
其他好文 时间:
2015-05-23 11:31:57
阅读次数:
127
http://acm.hdu.edu.cn/showproblem.php?pid=1016这道题是经典的素数环问题,相邻的两个数之和是素数。解题方法:用的是深搜,以1为起点,搜索,下一个数为出去前面的数字的集合。(用vis数组记录访问过的节点)剪枝:当前搜索值与数组前一个值之和不为素数的时候返回。...
分类:
其他好文 时间:
2015-05-23 06:23:53
阅读次数:
155
Description
On an alien planet, every extraterrestrial is born with a number. If the sum of two numbers is a prime number, then two extraterrestrials can be friends. But every extraterrestrial ca...
分类:
其他好文 时间:
2015-05-22 09:43:20
阅读次数:
161
新建了一个Java项目,添加了一个calculate.java的class,随后,将JUnit4引入该项目生成JUnit测试框架:在Eclipse的Package Explorer中用右键点击该类弹出菜单,选择“New à JUnit Test Case”随后在TestCaculate.java中为...
分类:
其他好文 时间:
2015-05-22 00:05:58
阅读次数:
262