刚刚创建Maven项目的时候出现了一点问题,新建工程的时候出现错误对话框:could not calculate build plan:plugin。(我是在开始配好Maven之后,在自动下载的时候给关了…),总之,解决方法就是找到maven的 .m2\repository\org\apache\m ...
分类:
其他好文 时间:
2018-09-09 20:01:37
阅读次数:
252
题目链接:https://nanti.jisuanke.com/t/31452 A prime number (or a prime) is a natural number greater than $1$ that cannot be formed by multiplying two smal ...
分类:
其他好文 时间:
2018-09-09 19:53:01
阅读次数:
192
A prime number (or a prime) is a natural number greater than 11 that cannot be formed by multiplying two smaller natural numbers. Now lets define a nu ...
分类:
其他好文 时间:
2018-09-08 20:04:49
阅读次数:
235
题意:求在树上任选一条路径,长度为质数的概率 直接点分,不难,之所以写是因为想记一下关于时间复杂度的东西... 我们采用按顺序加子树的方式统计答案,记一个深度有多少个点,卷积统计答案 如果当前节点的子树最深深度分别为$d_{1\cdots m}$,那么我们合并$i$时的数据规模为$\max\{d_{ ...
分类:
其他好文 时间:
2018-09-07 11:14:45
阅读次数:
221
用线性筛求莫比乌斯函数代码(摘) 日后慢慢看 ...
分类:
其他好文 时间:
2018-09-06 18:06:17
阅读次数:
151
1 #include 2 #include 3 #include 4 using namespace std; 5 const int N=1e5+10; 6 int Min[N],zs[N],cnt=0,n,phi[N]; 7 void prime(int n){ 8 memset(Min,0,s... ...
分类:
其他好文 时间:
2018-09-06 00:10:21
阅读次数:
182
The basic task is simple: given N real numbers, you are supposed to calculate their average. But what makes it complicated is that some of the input n ...
分类:
其他好文 时间:
2018-09-05 20:04:11
阅读次数:
196
题目链接: "HDU 1016" Description A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the ...
分类:
其他好文 时间:
2018-09-05 17:48:24
阅读次数:
140
处理何种问题:对于任何一个大于1的自然数num,num可以唯一分解为有限个质数乘积,如:num=的形式。(补充:这里的唯一的意思是在不考虑排列顺序的情况下) 性能:时间复杂度为O(sqrt(num)) 原理:唯一分解定理 实现步骤:类似于素数筛的求素数方法。 备注:当数据量大时建议先用素数筛把素数都 ...
分类:
其他好文 时间:
2018-09-04 20:50:18
阅读次数:
211
习题7:判断一个数是否是素数importmathdefis_prime(num):ifnum==1:returnFalseifnum==2:returnTrueelse:foriinrange(2,int(math.sqrt(num))+1):ifnum%i==0:returnFalsereturnTrueprint(is_prime(13))print(is_prime(12))print(is
分类:
编程语言 时间:
2018-09-03 17:46:39
阅读次数:
260