
欧拉函数
「已注销」
我的目标 离我还有多远我的梦想 有点遥不可及我要用十倍苦心做最突出一个我不能退缩 不管路多艰难 我都要努力我要靠自己的双手去做自己喜欢做的事我要靠自己的努力去我想去的地方旅游我还年轻 我还可以去奋斗
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
hdu4556-Stern-Brocot Tree
http://acm.hdu.edu.cn/showproblem.php?pid=4556#include#include#includeusing namespace std ;#define maxn 1000005#define INT __int64INT ans[ maxn + 1] ;void enlerfun(){ memset( ans , 0 , si原创 2013-06-08 14:42:01 · 1135 阅读 · 0 评论 -
poj3090-Visible Lattice Points
http://poj.org/problem?id=3090法雷级数,,欧拉函数#include#include#includeusing namespace std; #define maxn 1000005 #define INT __int64 int Prime[ maxn + 1 ] ;INT ans[ maxn + 1 ] ;void prime()原创 2013-06-07 18:43:11 · 1153 阅读 · 0 评论 -
hdu1286-找新朋友
http://acm.hdu.edu.cn/showproblem.php?pid=1286本来可以直接用普通的欧拉函数,但是,这个那样非常容易TLE,所以用素数筛法+欧拉函数;#include#include#include#includeusing namespace std ;#define maxn 100005int prime[ maxn + 1 ] ;int原创 2013-06-07 22:01:44 · 870 阅读 · 0 评论 -
poj2407-Relatives
http://poj.org/problem?id=2407欧拉函数#include#include#include#includeusing namespace std ;#define INT __int64int enlerfun( INT n ){ int tempnum = n ; for( int i = 2 ; i <= n ; ++i ) {原创 2013-06-07 14:15:12 · 1473 阅读 · 0 评论 -
poj2478-Farey Sequence
http://poj.org/problem?id=2478素数筛法+欧拉函数#include#include#includeusing namespace std; #define maxn 1000005 #define INT __int64 int Prime[ maxn + 1 ] ;INT ans[ maxn + 1 ] ;void prime(){原创 2013-06-07 14:46:21 · 1093 阅读 · 0 评论 -
hdu1787-GCD Again
http://acm.hdu.edu.cn/showproblem.php?pid=1787非数组形式,用于大数据#include#include#include#includeusing namespace std ;#define INT __int64int enlerfun( int n ){ int tempnum = 1 ; int i ; for( i原创 2013-06-08 13:31:50 · 974 阅读 · 0 评论 -
hdu3501-Calculation 2
http://acm.hdu.edu.cn/showproblem.php?pid=3501这题参考了别人的代码,才知道原来当数据较大时求解前n 项的欧拉函数和,可以直接利用 n * enlerfun( n) / 2求解,而此题要求的是非互质的,同样可以使用这个性质#include#include#includeusing namespace std ;#define MOD原创 2013-06-08 14:07:42 · 1180 阅读 · 0 评论 -
hdu2824-The Euler function
http://acm.hdu.edu.cn/showproblem.php?pid=2824#include#include#includeusing namespace std; #define maxn 3000010#define INT __int64 int Prime[ maxn + 1 ] ;INT ans[ maxn + 1 ] ;void enlerfu原创 2013-06-08 14:43:34 · 950 阅读 · 0 评论 -
hdu2837数论
http://acm.hdu.edu.cn/showproblem.php?pid=2837#include#include#include#include#include#include#includeusing namespace std;#define INT long long INT euler( int n){ INT ret=1,i; for (i=原创 2013-07-26 20:35:31 · 1612 阅读 · 0 评论