题目来源:Light OJ 1356 Prime Independence
题意:给你n个数 选出最多的数构成一个集合使得任何2个数不是另外一个数的质数倍 x!=k*y
思路:矛盾的2个数连边 并且所有数分成质因子数为奇数和偶数两部分 以质因子奇偶不同构建二分图 同奇 同偶的数一定不是另外一个数的质数倍
判断矛盾 首先对每个数因子分解 例如x 有a1个p1质因子 a2个p2质因子...an...
分类:
其他好文 时间:
2014-08-06 19:09:32
阅读次数:
303
Description
The branch of mathematics called number theory is about properties of numbers. One of the areas that has captured the interest of number theoreticians for thousands of years is the qu...
分类:
其他好文 时间:
2014-08-06 19:06:42
阅读次数:
319
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 1058Description A number whose only prime factors are ....
分类:
其他好文 时间:
2014-08-06 14:11:31
阅读次数:
276
Description
Once upon a time, in the Kingdom of Loowater, a minor nuisance turned into a major problem.
The shores of Rellau Creek in central Loowater had always been a prime breeding ground for g...
分类:
其他好文 时间:
2014-08-06 10:37:41
阅读次数:
257
CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for...
分类:
其他好文 时间:
2014-08-05 19:42:30
阅读次数:
236
#include #include #include #include using namespace std;int a[1000001];int prime[1000001];int main(){ int k,tt=0; int p; a[0]=a[1]=0; a[2...
分类:
其他好文 时间:
2014-08-05 18:39:19
阅读次数:
171
题目地址:Prime Path题目大意: 给你两个四位数的素数,通过改变其中的一个数,每次只允许改变一位数,而且改变之后的数也必须是个素数,问你最少通过改变几次变成后一个四位的素数。如果不能改变成后面的四位素数则输出Impossible。解题思路: 广搜,枚举改变每一位(千、百、十、个)数 进队.....
分类:
其他好文 时间:
2014-08-05 13:34:59
阅读次数:
241
Prime Palindrome GolfDo you know how to play Prime Palindrome Golf? You are given a number and your challenge is to find the closest palindromic prime...
分类:
其他好文 时间:
2014-08-05 13:24:49
阅读次数:
274
截图 :cal.jsJs代码varClass={};Class.calculation=function(){varcalculation={};calculation.result=0;calculation.calculate=function(num1,num2){};calculation....
分类:
编程语言 时间:
2014-08-05 09:27:18
阅读次数:
294
最小生成树
给定一无向带权图,顶点数是n,要使图连通只需n-1条边,若这n-1条边的权值和最小,则称有这n个顶点和n-1条边构成了图的最小生成树(minimum-cost spanning tree)。
Prim算法
Prim算法是解决最小生成树的常用算法。它采取贪心策略,从指定的顶点开始寻找最小权值的邻接点。图G=,初始时S={V0},把与V0相邻接,且边的权值最小的顶点加入到S。不断地把S中的顶点与V-S中顶点的最小权值边加入,直到所有顶点都已加入到S中。...
分类:
其他好文 时间:
2014-08-05 00:39:08
阅读次数:
313