2014年11月13日

摘要: typedef __int64 ll;ll gao(ll l,ll r,ll n){//[l,r]内与n互素的数字个数 vector v; for(ll i=2;i*i1)v.push_back(n); int m=v.size(); ll res=0; for(... 阅读全文
posted @ 2014-11-13 23:17 LegendaryAC 阅读(162) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1695x是[1,b],y是[1,d],求GCD(x,y)=k的对数(x,y无序)对x,y都除以k,则求GCD(x,y)=1此时枚举x,问题转化为[1,d]区间内与x互素的数字个数,这个问题是hdu 4135有一个特... 阅读全文
posted @ 2014-11-13 23:04 LegendaryAC 阅读(396) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4135求[A,B]内与N互素的数字个数首先对N分解质因数,对于一个质因数,1-n与它不互素的数字个数是n/(这个质因数),这样可以得到m个集合(m是N分解出的质因数的个数),对这m个集合用容斥原理解出来它们的并集,... 阅读全文
posted @ 2014-11-13 05:11 LegendaryAC 阅读(199) 评论(0) 推荐(0) 编辑