转自:http://blog.csdn.net/watkinsong/article/details/7882443方式一:[csharp]view plaincopyfunctionresult=gaborKernel2d(lambda,theta,phi,gamma,bandwidth)%GAB...
分类:
其他好文 时间:
2014-11-05 12:18:08
阅读次数:
283
#include #include using namespace std;#define CLR( a, b ) memset( a, b, sizeof(a) )#define MAXN 1010int phi[ MAXN ], farey[ MAXN ], n, t;void get_eul....
分类:
其他好文 时间:
2014-11-04 18:49:58
阅读次数:
203
由题意可知,anw = (b-1)*b^(n-1)%c,则重点为求b^(n-1)。
弱渣推不出来只能上公示。
phi(c)为小于c且与c互质的个数。
当x >= phi(c)时:A^x = A(x%phi(c) + phi(c)) 。
当x
#include
#include
#include
#include
#include
#include
#include
#i...
分类:
其他好文 时间:
2014-11-03 19:27:25
阅读次数:
200
gcd(x,y)(1 gcd(x/k,y/k)=1,k是x的质因数 的个数 Σφ(x/k) (1 2 using namespace std; 3 typedef long long ll; 4 int phi[10000001],n; 5 bool unPrime[10000001]; 6 ll ...
分类:
其他好文 时间:
2014-11-01 18:59:33
阅读次数:
164
∵∑gcd(i, N)(1 gcd(x/ki,N/ki)=1 (1 2 #include 3 using namespace std; 4 typedef long long ll; 5 ll n,ans; 6 int phi(ll x) 7 { 8 ll res=x; 9 for(...
分类:
其他好文 时间:
2014-11-01 16:15:10
阅读次数:
186
13. (Caylay 变换) 记 $i=\sqrt{-1}$. 若 $A$ 为 Hermite 矩阵, 则 $$\bex \phi(A)=(A-iI)(A+iI)^{-1} \eex$$ 是一个酉矩阵.
分类:
其他好文 时间:
2014-11-01 13:08:30
阅读次数:
188
要求a^b^c mod p保证gcd(c,p)=1用费马小定理b:=quick_mod(b,c,p-1);c:=quick_mod(a,b,p);a^c mod p=a^(c mod phi(p)) mod p而素数的phi函数是无需计算的,即p-1推广到多个,依次降幂即可。不断应用快速幂。var ...
分类:
其他好文 时间:
2014-10-29 18:50:13
阅读次数:
198
考察欧拉函数的一道题
首先要知道 【定理】正整数n(n≥2)可以唯一分解成素数乘积,即:n =p[1]^r1 * p[2] ^r2 * p[3]^r3. *...* p[s]^rs???
其次欧拉函数有两个性质,可以用来编程,单独求phi函数:
① phi(m) = m ( 1- 1/p[1]) ( 1- 1/p[2])…( 1- 1/p[s])
② phi(p^k)...
分类:
其他好文 时间:
2014-10-27 23:04:25
阅读次数:
230
我承认开这篇文章只是因为好笑……估计Zky神看见3737会很郁闷吧。本来想直接交3737改的,后来为了常数党的尊严还是补了最优性剪枝。另有一些若当前n+1是质数了,就直接返回当前值*(n+1)……然后又把顺搜改成倒搜,最后20ms……毕竟双倍福利。话说上回好声音在学校边上办演唱会各种打扰,然后某节晚...
分类:
其他好文 时间:
2014-10-15 20:08:31
阅读次数:
249
题目大意:令Sum(i)为i在二进制下1的个数 求∏(1
一道很简单的数位DP 首先我们打表打出组合数 然后利用数位DP统计出二进制下1的个数为x的数的数量 最后输出∏(1
此题的坑在于这题的组合数和数位DP的结果都是指数 对指数取模不能直接取 要取Phi(p)
于是我们对10000006取模 然后这题就WA了 因为10000007不是个质数!
10000007=941*10627 于是我...
分类:
其他好文 时间:
2014-10-09 22:15:04
阅读次数:
268