码迷,mamicode.com
首页 >  
搜索关键字:欧拉函数    ( 1054个结果
欧拉函数,求素数
/*=======================================================*\ | 递推求欧拉函数phi(i) 欧拉函数\varphi(n)是小于或等于n的正整数中与n互质的数的数目\*=====================================...
分类:其他好文   时间:2015-01-29 12:29:08    阅读次数:132
POJ2480:Longge's problem(欧拉函数的应用)
题目链接:传送门题目需求:Given an integer N(1 #include #include #include #include typedef long long ll;using namespace std;ll phi[100005];ll f[10005];ll sum,n,t,t...
分类:其他好文   时间:2015-01-26 20:54:56    阅读次数:200
HDU2588:GCD(欧拉函数的应用)
题目链接:传送门题目需求:Given integers N and M, how many integer X satisfies 1=M.(2=M。这才是核心:要求有多少个 i 满足gcd(i, N) = d(1=M,就是求N的因子中大于等于M的欧拉函数值,即gcd(N/d1)+gcd(N/d2)...
分类:其他好文   时间:2015-01-26 20:52:56    阅读次数:202
HDU1695:GCD(容斥原理+欧拉函数+质因数分解)好题
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1695题目解析:Given 5 integers: a, b, c, d, k, you're to find x in a...b, y in c...d that GCD(x, y) = k.题目又说...
分类:其他好文   时间:2015-01-25 16:27:29    阅读次数:175
N的互质数----欧拉函数
Description新年快到了,“猪头帮协会”准备搞一个聚会,已经知道现有会员N人,把会员从1到N编号,其中会长的号码是N号,凡是和会长是老朋友的,那么该会员的号码肯定和N有大于1的公约数,否则都是新朋友,现在会长想知道究竟有几个新朋友?请你编程序帮会长计算出来。Input第一行是测试数据的组数C...
分类:其他好文   时间:2015-01-20 20:28:45    阅读次数:171
(欧拉函数) SGU 102
A -CoprimesTime Limit:250MSMemory Limit:4096KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeSGU 102Appoint description:DescriptionFor given integer...
分类:其他好文   时间:2015-01-20 13:31:06    阅读次数:141
BZOJ 3288 Mato矩阵 线性筛
题目大意:一个M*M的矩阵,(i,j)位置上的值是gcd(i,j),问这个矩阵的行列式的值。 思路:考试的时候考了这个题,有人居然打表发现规律,简直跪啊。。。 其实用高斯消元之后不难发现,要求的就是从1到m的phi的乘积,一个线性筛就解决了。 CODE: #include #include #include #include #define MAX 1000...
分类:其他好文   时间:2015-01-11 09:45:57    阅读次数:146
【3288】Mato矩阵 打表找规律
算是欧拉函数线性筛的模板了吧?...
分类:其他好文   时间:2015-01-10 19:46:39    阅读次数:178
BZOJ 3288 Mato矩阵 线性筛
题目大意:给定一个n阶行列式,第i行第j列为GCD(i,j),求这个行列式的值 高斯消元之后发现对角线上的东西是phi 于是线性筛出所有的欧拉函数即可 /* #include #include #include #include #include #define M 110 using namespace std; int n; double f[M][M]; void Gauss...
分类:其他好文   时间:2015-01-09 10:51:17    阅读次数:128
hdu1695--GCD(欧拉函数+容斥原理)
GCD Time Limit:3000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Appoint description:  System Crawler  (2015-01-07) Description Given 5 integers: a, b,...
分类:其他好文   时间:2015-01-08 22:52:22    阅读次数:300
1054条   上一页 1 ... 87 88 89 90 91 ... 106 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!