
紫书第10章数学
santiago1
struggle
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
uva 11105 semi-prime H-numbers
#include <cstdio> using namespace std; const int maxn = 1000010; bool nhp[maxn]; int hp[maxn],hpnum; int cnt[maxn]; void pre() { for(int i = 5; i < 1010; i += 4) if(!nhp[i]) ...原创 2019-10-21 12:44:56 · 196 阅读 · 0 评论 -
uva 11526 h(n)
怎么计算sum{ [n/i] }?(1<=i<=n)(n<=2147483647) n太大,硬算肯定不行,我们先观察一个例子,看能否得出一些结论。 当n=20时,和式展开为 20+10+6+5+4+3+2+2+2+2+1+1+1+1+1+1+1+1+1+1 注意到后面相同的数太多,不妨化简下: 20+10+6+5+1*(20-10)+2*(10-6)+3*(6-5)+4*(5-4...转载 2019-10-20 23:54:01 · 151 阅读 · 0 评论 -
uva 1210连续素数之和
1原创 2019-10-20 22:31:01 · 201 阅读 · 0 评论 -
uva 1213不同素数之和
转载与https://blog.youkuaiyun.com/geekcome/article/details/6159991原创 2019-10-20 22:29:44 · 186 阅读 · 0 评论 -
uva1644 素数间隔
#include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <vector> #include <string> #include <map> #include...原创 2019-10-20 18:56:57 · 235 阅读 · 0 评论 -
UVa1643 - Angle and Squares
转载于原文链接:https://blog.youkuaiyun.com/a197p/article/details/45670221 有n个正方形和一个角(均在第一象限中),使这些正方形与这个角构成封闭的阴影区域,求阴影区域面积的最大值。 分析: 直观上来看,当这n个正方形的对角线在一条直线上时,封闭区域的面积最大。 设所有正方形边长之和为L,OA、OB两直线方程分别为:y = k1x y = k2x,设...转载 2019-10-20 18:34:28 · 141 阅读 · 0 评论