题目地址:POJ 3126 题意:给你两个4位的都是素数正整数n,m,每次能够变 个十百千位 中的一个数(变化后也是素数,问最少经过多少次变化n能变成m,假设不能输出Impossible(窝认为并没有不成立的情况 思路:每次变化一位,然后搜就好了。 #include <stdio.h> #inclu ...
分类:
其他好文 时间:
2017-06-23 20:47:39
阅读次数:
142
寻找素数对 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13823 Accepted Submission(s): 6981 Problem ...
分类:
其他好文 时间:
2017-06-21 11:21:56
阅读次数:
150
使用pip安装Python扩展库memory_profiler 1 from memory_profiler import profile 2 3 @profile #修饰器 4 def isPrime(n): 5 if n == 2: 6 return True 7 for i in range(... ...
分类:
编程语言 时间:
2017-06-19 18:42:56
阅读次数:
231
Building a Space Station Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 5874 Accepted: 2914 Description You are a member of the space stat ...
分类:
其他好文 时间:
2017-06-19 13:10:56
阅读次数:
197
?? Prime Ring Problem Time Limit: 10 Seconds Memory Limit: 32768 KB A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., ...
分类:
其他好文 时间:
2017-06-19 09:51:37
阅读次数:
198
UVA 1415 - Gauss Prime 题目链接 题意:给定a + bi,推断是否是高斯素数,i = sqrt(-2)。 思路:普通的高斯素数i = sqrt(-1),推断方法为: 1、假设a或b为0。推断还有一个数为4 * n + 3形式的素数(用到费马平方和定理) 2、假设a、b都不为0, ...
分类:
其他好文 时间:
2017-06-18 13:23:58
阅读次数:
140
Starting with 1 and spiralling anticlockwise in the following way, a square spiral with side length 7 is formed. 37 36 35 34 33 32 31 38 17 16 15 14 1 ...
分类:
其他好文 时间:
2017-06-18 12:12:06
阅读次数:
172
P1217 [USACO1.5]回文质数 Prime Palindromes 题目描述 因为151既是一个质数又是一个回文数(从左到右和从右到左是看一样的),所以 151 是回文质数。 写一个程序来找出范围[a,b](5 <= a < b <= 100,000,000)( 一亿)间的所有回文质数; ...
分类:
其他好文 时间:
2017-06-15 21:50:25
阅读次数:
156
F - Prime Independence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 128000/64000 KB (Java/Others) Submit Status F - Prime Independence Time Li ...
分类:
其他好文 时间:
2017-06-14 20:16:54
阅读次数:
263
链接 分析:对于三位数我们限定为[100,999],两位数我们限定为[10,99],然后我们依次判断是否满足乘法式且各个数位是否在数列中,若都满足+1 1 /* 2 PROB:crypt1 3 ID:wanghan 4 LANG:C++ 5 */ 6 #include "iostream" 7 #i ...
分类:
其他好文 时间:
2017-06-13 22:44:04
阅读次数:
134