Twin Primes Twin primes are pairs of primes of the form (p; p + 2). The term \twin prime" was coined by PaulStckel (1892-1919). The rst few twin prime ...
分类:
其他好文 时间:
2019-08-29 09:21:43
阅读次数:
65
Problem A 数学题 设数论函数$f(x)$表示$x(x ? Prime)$的次大因数, 给出$l,r$求出$\sum\limits_{i=l,i ? Prime} ^r f(i)$ 。 对于$100\%$的数据,$1 \leq l\leq r\leq 5\times 10^9$ Soluti ...
分类:
其他好文 时间:
2019-08-29 00:05:51
阅读次数:
86
const int N=100000+5; bool prime[N];//prime[i]表示i是不是质数 int p[N],tot;//p[N]用来存质数 void init() { //初始化为质数 for(int i=2;i<N;i++) prime[i]=true; for(int i=2... ...
分类:
其他好文 时间:
2019-08-28 10:51:02
阅读次数:
64
"LightOJ1259" Goldbach`s Conjecture 标签 线性筛 前言 我的csdn和博客园是同步的,欢迎来访 "danzh 博客园" ~ 简明题意 给定n(n const int maxn = 1e7 + 10; bool no_prime[maxn]; int prime[( ...
分类:
数据库 时间:
2019-08-27 17:24:33
阅读次数:
69
PAT A1001 A+B Format 题目描述: Calculate a+b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas ...
分类:
其他好文 时间:
2019-08-26 15:13:36
阅读次数:
80
【简单递归】 题目描述 已知 n 个整数b1,b2,…,bn 以及一个整数 k(k<n)。 从 n 个整数中任选 k 个整数相加,可分别得到一系列的和。 例如当 n=4,k=3,4 个整数分别为 3,7,12,19 时,可得全部的组合与它们的和为: 3+7+12=22 3+7+19=29 7+12+ ...
分类:
其他好文 时间:
2019-08-25 13:51:11
阅读次数:
79
本题考点:欧拉降幂 Super A^B mod C Given A,B,C, You should quickly calculate the result of A^B mod C. (1<=A,C<=1000000000,1<=B<=10^1000000). Given A,B,C, You s ...
分类:
其他好文 时间:
2019-08-22 22:15:39
阅读次数:
149
Given a positive integer N, your task is to calculate the sum of the positive integers less than N which are not coprime to N. A is said to be coprime ...
分类:
其他好文 时间:
2019-08-22 14:45:56
阅读次数:
63
题目描述 A positive integer is called a "prime-factor prime" when the number of its prime factors is prime. For example, 12 is a prime-factor prime becaus ...
分类:
其他好文 时间:
2019-08-21 00:13:23
阅读次数:
77
最小生成树。 题意就是有N座城市,每个城市有一定的幸福值a[i]。对于任意两个城市i和j,如果a[i],a[j],a[i]+a[j]中任意一者的值为素数,那么他们的边权就是min(min(a[i],a[j]),abs(a[i]-a[j]))。问题就是这一幅图的最小生成树。显然,边一旦建出来了,这就是 ...
分类:
其他好文 时间:
2019-08-20 21:56:52
阅读次数:
72