"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
【简单递归】 题目描述 已知 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
题目描述 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
一、v-model.lazy 只有在input输入框发生一个blur时才触发 v-model绑定的变量正常输入的时候会同步更新,加上lazy时只在失去焦点时更新绑定的变量。 二、v-model.trim 将用户输入的前后的空格去掉 三、v-model.number 将用户输入的字符串转换成numbe ...
分类:
其他好文 时间:
2019-08-20 16:41:03
阅读次数:
93
一,list集合排序 对于自定义数据类型,排序可以用Collections集合工具类中的sort()方法, 而要想使用sort()方法则必须实现Comparable接口然后重写里面的compareTo方法或单独一个类实现Comparactor接口也重写里面的compareTo方法 String类型已 ...
分类:
编程语言 时间:
2019-08-18 15:26:05
阅读次数:
80
(Note: All are taken to mean , unless indicated otherwise).[edit]The algorithm Inputs: p, an odd prime. n, an integer which is a quadratic residue (mo ...
分类:
其他好文 时间:
2019-08-17 00:48:36
阅读次数:
94
Given a number N, you are asked to count the number of integers between A and B inclusive which are relatively prime to N. Two integers are said to be ...
分类:
其他好文 时间:
2019-08-15 22:45:15
阅读次数:
106
Given a number N, you are asked to count the number of integers between A and B inclusive which are relatively prime to N. Two integers are said to be ...
分类:
其他好文 时间:
2019-08-15 21:10:45
阅读次数:
89
题目 https://cn.vjudge.net/problem/Gym-101840H 题意 给出一棵树,问有多少对点,将他们之间的边权相乘之后所获得的值仅有两个不同的质因子。 题解 当时没想着用并查集做,写了个点分治= =。我们对于重心的子树挨个搜索,用number数组记录下质因子数量为0, 1 ...
分类:
其他好文 时间:
2019-08-15 21:04:33
阅读次数:
86