
----- 素数相关
谙忆
公众号:程序编程之旅。曾经写过C、C++,使用过Cocos2dx开发过游戏、安卓端、IOS端、PC端页面均开发过。目前专注Java开发,SaaS内核、元数据的研究。偶尔玩玩爬虫
-
原创 HDOJ(HDU) 2136 Largest prime factor(素数筛选)
Problem Description Everybody knows any number can be combined by the prime number. Now, your task is telling me what position of the largest prime factor. The position of prime 2 is 1, prime 3 is 22016-05-03 20:30:4211458
0
-
原创 HDOJ/HDU 2710 Max Factor(素数快速筛选~)
Problem Description To improve the organization of his farm, Farmer John labels each of his N (1 <= N <= 5,000) cows with a distinct serial number in the range 1..20,000. Unfortunately, he is unaware2016-05-19 00:39:053542
0
-
原创 ZOJ Problem Set - 3758 素数
Singles’ DayTime Limit: 2 Seconds Memory Limit: 65536 KB Singles’ Day(or One’s Day), an unofficial holiday in China, is a pop culture entertaining holiday on November 11 for young Chinese to celeb2015-08-23 18:36:23866
0
-
原创 HDOJ 2012 素数判定
Problem Description 对于表达式n^2+n+41,当n在(x,y)范围内取整数值时(包括x,y)(-39<=ximport java.util.Scanner;class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); while(s2015-11-06 19:10:26778
0
-
原创 HDOJ(HDU) 2161 Primes(素数打表)
Problem Description Write a program to read in a list of integers and determine whether or not each number is prime. A number, n, is prime if its only divisors are 1 and n. For this problem, the numbe2016-05-05 19:24:144185
0
-
原创 HDOJ 2098 分拆素数和
Problem Description 把一个偶数拆成两个不同素数的和,有几种拆法呢?Input 输入包含一些正的偶数,其值不会超过10000,个数不会超过500,若遇0,则结束。Output 对应每个偶数,输出其拆成不同素数的个数,每个结果占一行。Sample Input 30 26 0Sample Output 3 2素数打表法!import java.util.Scanner;2016-02-19 16:59:28734
0
-
原创 HDOJ 1164 Eddy's research I(拆分成素数因子)
Problem Description Eddy’s interest is very extensive, recently he is interested in prime number. Eddy discover the all number owned can be divided into the multiply of prime number, but he can’t writ2016-04-01 19:38:212151
0
-
原创 HDOJ 1397 Goldbach's Conjecture(快速筛选素数法)
Problem Description Goldbach’s Conjecture: For any even number n greater than or equal to 4, there exists at least one pair of prime numbers p1 and p2 such that n = p1 + p2. This conjecture has not2016-04-11 03:11:111306
0
-
原创 HDOJ(HDU) 2138 How many prime numbers(素数-快速筛选没用上、)
Problem Description Give you a lot of positive integers, just to find out how many prime numbers there are.Input There are a lot of cases. In each case, there is an integer N representing the num2016-05-05 01:30:232058
0
-
原创 HDOJ(HDU) 2521 反素数(因子个数~)
Problem Description 反素数就是满足对于任意i(0< i < x),都有g(i) < g(x),(g(x)是x的因子个数),则x为一个反素数。现在给你一个整数区间[a,b],请你求出该区间的x使g(x)最大。Input 第一行输入n,接下来n行测试数据 输入包括a,b, 1<=a<=b<=5000,表示闭区间[a,b].Output 输出为一个整数,为该区间因子最多的数.如2016-05-10 01:51:044351
0