题意:给定一个大数k,k是两个大素数的乘积的值,再给定一个int内的数L
问这两个大素数中最小的一个是否小于L,如果小于则输出这个素数。
分析:因为k达到了10^100,只能用字符串读入,再转化为千进制,用int数组存储,
然后枚举小于L的素数,看是否能被整除,即判断k%L是否为0,
这样就得先用筛选法求素数打表,但是注意要打表到大于10^6
关于高精度取余,就需要用到同余定理...
分类:
其他好文 时间:
2014-11-05 17:20:29
阅读次数:
168
1 #include 2 #include 3 int main() 4 { 5 int i=2, a=100, flag=0; 6 for (a=100;a<=1000;a++) 7 { 8 flag=0; 9 i= 2;10 ...
分类:
其他好文 时间:
2014-11-05 17:05:01
阅读次数:
147
<script>
var keleyijson={"plug1":"myslider","plug2":"zonemenu","plug3":"keleyi"}
function JSONLength(obj) {
var size = 0, key;
for (key in obj) {
if (obj.hasOwnProperty(key)) size++;
}
return size...
分类:
Web程序 时间:
2014-11-05 15:11:46
阅读次数:
136
c#:int[] array1; int[] array2 = new int[2]; int[] array3 = new int[] { 1, 2, 3 };//new int[]方括号中可以写长度也可以不写,但是写了的话必须和花括号中的元素数量相等,不等则报错 ...
分类:
编程语言 时间:
2014-11-05 01:48:50
阅读次数:
109
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-11-05 00:33:10
阅读次数:
200
题目:判断n!能否整除m。
分析:数论。先将m拆成素数的积的形式,再判断n!中对应每个素数的个数,是否大于m的即可。
首先,打表计算50000内素数,用这些素数除不尽的数一定也是素数,不过最多只有一个;
然后,分解m成素数的积的形式,统计每个素数因子的个数;
最后,判断n!中每个素数因子的个数是否大于m中对应的素数个数...
分类:
其他好文 时间:
2014-11-04 19:45:52
阅读次数:
195
A:Aizu 0009 Prime
Number:素数筛选,注意可能爆内存!!。
#include
#include
#include
#include
#include
typedef long long LL;
using namespace std;
#define REPF( i , a , b ) for ( int i = a ; i <= b ; ++ i )
#defin...
分类:
其他好文 时间:
2014-11-04 15:07:04
阅读次数:
254
题意:求A^B的所有因子的和对9901取余后的值
如:2^3=8,8的因子有 1,2,4,8,所有和为15,取余后也是15
应用定理主要有三个:
(1)整数的唯一分解定理:
任意正整数都有且只有一种方式写出其素因子的乘积表达式。
A=(p1^k1)*(p2^k2)*(p3^k3)*....*(pn^kn) 其中pi均为素数...
分类:
其他好文 时间:
2014-11-04 09:22:55
阅读次数:
194
2014.11.4 7:33 还有三天半就要NOIP,圈一下要背的知识点:一、数论1、素数判断2、筛法求素数3、求一个数的欧拉函数值4、预处理欧拉函数5、卡塔兰数递推式6、快速幂(模素数的乘法逆元)7、GCD二、图论1、最短路:①堆dijkstra ②spfa2、kruscal 最小生成树3、LCA...
分类:
其他好文 时间:
2014-11-04 08:05:37
阅读次数:
128
大纲
1、android中res目录下的文件夹所对应屏幕尺寸
2、用dp表示尺寸的原理
3、对于720p尺寸的适配需要注意什么
4、ui切图按什么尺寸给最好
参考:http://www.360doc.com/content/12/0301/17/5087210_190881395.shtml
几个概念:
1) 屏幕密度(dpi) :dot per inch,即每英寸像素数。
...
分类:
移动开发 时间:
2014-11-03 22:37:55
阅读次数:
337