Description Everybody in the Prime Land is using a prime base number system. In this system, each positive integer x is represented as follows: Let {p ...
分类:
其他好文 时间:
2016-03-27 11:08:35
阅读次数:
142
A ring is composed of n (even number) circles as shown in diagram. Put natural numbers into each circle separately, and the sum of numbers in two adja ...
分类:
其他好文 时间:
2016-03-24 01:05:12
阅读次数:
133
QQ:16264558 TEL:13963782271
质数(prime number)又称素数,有无限个。除了1和它本身以外不再有其他的除数整除。
分类:
其他好文 时间:
2016-03-20 16:13:25
阅读次数:
201
//问一个区间[a,b]与n互素的数的个数 //利用容斥原理可知 //在[a,b] 区间内对n的素数因子 //ans = 被一个数整除的数的个数 - 被两个数的最小公倍数整除的数的个数 + 被三个数的。。。 #include<cstdio> #include<cstring> #include<io
分类:
其他好文 时间:
2016-03-16 12:10:50
阅读次数:
131
1.打印100~200之间的素数2.输出乘法口诀表3.判断1000年---2000年之间的闰年#include<stdio.h>#include<stdlib.h>#include<math.h>intmain(){intcount=0;intdiv=0;printf("输出100—200之间的素数\n");for(intprime=101;prime<=200;prime+=2){for(div=2;di..
分类:
其他好文 时间:
2016-03-16 01:36:58
阅读次数:
246
题目大意是给出两个四位素数,让你通过每次改变其中一位数的操作,来将a变成b,并且过程中所有的数都是无前导0的4为素数,(题面我真的吐槽不能啊,傲娇的prime一定要prime。。。。) 这题感觉和poj1426很像。也是通过某种操作得到一颗解答树,然后对其进行bfs。 用字符串(整数也可以,但我觉得
分类:
其他好文 时间:
2016-03-14 15:16:04
阅读次数:
169
#include <stdio.h> int prime[1000001],k=0;bool vis[1000001]; void init(){ for(int i=2;i<=1000;i++) if(vis[i]==false) for(int j=i+i;j<=1000000;j+=i) vi
分类:
其他好文 时间:
2016-03-09 20:49:27
阅读次数:
187
The first two consecutive numbers to have two distinct prime factors are: 14 = 2 × 7 15 = 3 × 5 The first three consecutive numbers to have three dist
分类:
其他好文 时间:
2016-03-07 10:10:09
阅读次数:
142
Super Ugly Number: Write a program to find the nth super ugly number.Super ugly numbers are positive numbers whose all prime factors are in the given ...
分类:
其他好文 时间:
2016-03-06 20:40:54
阅读次数:
126