#include #include #include #include #include using namespace std; #define maxn 50000 int vis[maxn], isprime[5200], num[100005], k; void prime()//只需要把[... ...
分类:
其他好文 时间:
2018-09-30 18:13:04
阅读次数:
174
Given a set of n DNA samples, where each sample is a string containing characters from {A, C, G, T}, we are trying to find a subset of samples in the ...
分类:
其他好文 时间:
2018-09-06 14:47:45
阅读次数:
208
<题目链接> 题目大意:有n个城市,每一个城市有一个拥挤度Ai,从一个城市I到另一个城市J的时间为:(A(v)-A(u))^3。问从第一个城市到达第k个城市所花的时间,如果不能到达,或者时间小于3输出?否则输出所花的时间。 解题分析: 很明显,此题路段的权值可能为负,所以我们就不能用Dijkstra ...
分类:
其他好文 时间:
2018-09-01 00:03:10
阅读次数:
163
1203 - Guarding Bananas PDF (English) Statistics Forum Time Limit: 3 second(s) Memory Limit: 32 MB Once there was a lazy monkey in a forest. But he lo ...
分类:
其他好文 时间:
2018-08-30 00:11:46
阅读次数:
275
题目大意:给出一个n(1 <= n < 2^31)求出H(n)的结果,H(n)的定义为下: 分析:对于一个n,设 t = n / i: 满足 t >= 1的有多少个呢? 有 n / 1 个。 满足 t >= 2的有多少个呢? 有 n / 2 个。 …… 满足 t >= k的有多少个呢? 有 n / ...
分类:
其他好文 时间:
2018-08-12 15:40:41
阅读次数:
181
题目链接:https://vjudge.net/problem/LightOJ-1282 求后三位我们可以用快速幂取模算出来,但是前三位怎么办呢? 对于任意一个数y,都可以表示为10^x,这实际上就是一个以10为底的指数函数,y = 10^x,所以x = log10(y),这个x就分为整数部分和小数 ...
分类:
其他好文 时间:
2018-08-09 22:02:37
阅读次数:
138
题意:给N个数,求对每个数ai都满足最小的phi[x]>=ai的x之和。 分析:先预处理出每个数的欧拉函数值phi[x]。对于每个数ai对应的最小x值,既可以二分逼近求出,也可以预处理打表求。 ...
分类:
其他好文 时间:
2018-08-07 20:31:00
阅读次数:
131
#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #de... ...
分类:
其他好文 时间:
2018-08-01 16:38:58
阅读次数:
146
这题和这题一样。。。。。。只不过多了个数。。。 Finding LCM LightOJ - 1215 https://www.cnblogs.com/WTSRUVF/p/9316412.html ...
分类:
其他好文 时间:
2018-07-22 16:55:05
阅读次数:
146
We define b is a Divisor of a number a if a is divisible by b. So, the divisors of 12 are 1, 2, 3, 4, 6, 12. So, 12 has 6 divisors. Now you have to or ...
分类:
其他好文 时间:
2018-07-22 14:07:04
阅读次数:
158