一、莫比乌斯(Möbius)函数 对于每个正整数n(n ≥ 2),设它的质因数分解式为: 根据这个式子定义n的莫比乌斯函数为: 也就是如果n有平方因子,则为0. 否则是-1的质因数个数次方。 举个简单的例子:6 = 2 × 3,所以; 9 = 3×3, 所以 【命题一】 对于正...
分类:
其他好文 时间:
2014-10-31 20:34:27
阅读次数:
316
GCDTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6081Accepted Submission(s): 2223Problem Descrip...
分类:
其他好文 时间:
2014-10-31 11:28:47
阅读次数:
178
7001. Visible Lattice Points
Problem code: VLATTICE
Consider a N*N*N lattice. One corner is at (0,0,0) and the opposite one is at (N,N,N). How many lattice points are visible from co...
分类:
其他好文 时间:
2014-10-24 11:05:49
阅读次数:
294
N. Sky CodeTime Limit:1000msCase Time Limit:1000msMemory Limit:65536KB64-bit integer IO format:%lld Java class name:MainSubmitStatusFont Size:+-Stancu...
分类:
其他好文 时间:
2014-10-18 11:08:05
阅读次数:
242
这次求的是三维的。如上篇一样,使用那个特殊的莫比乌斯反演来做。需要注意的是,求得的只是从(1,1,1)到(n,n,n)的互质的个数,还要注意墙壁三面如(0,1,1)~(0,n,n)等。最后+3。因为是(0,0,1);#include #include #include #include #defin...
分类:
其他好文 时间:
2014-10-03 12:58:24
阅读次数:
279
GCD SUMTime Limit:8000/4000MS (Java/Others)Memory Limit:128000/64000KB (Java/Others)SubmitStatisticNext ProblemProblem Description给出N,M执行如下程序:long lon...
分类:
其他好文 时间:
2014-09-01 08:09:42
阅读次数:
201
Mophues
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 327670/327670 K (Java/Others)
Total Submission(s): 647 Accepted Submission(s): 263
Problem Description
As we know, any po...
分类:
其他好文 时间:
2014-08-27 20:35:28
阅读次数:
374
SPOJ Problem Set (classical)7001. Visible Lattice PointsProblem code: VLATTICEConsider a N*N*N lattice. One corner is at (0,0,0) and the opposite one ...
分类:
其他好文 时间:
2014-08-24 20:42:43
阅读次数:
146
Problem Description
Teacher Mai finds that many problems about arithmetic function can be reduced to the following problem:
Maintain an array a with index from 1 to l. There are two kinds of ope...
分类:
其他好文 时间:
2014-08-18 16:26:42
阅读次数:
248
http://acdream.info/problem?pid=1114题目大意,给你一个序列a,求出这个序列中互质数的有多少对。其中所有的整数的都小于等于222222。f(d) 为 gcd 恰好为 d 的数的对数, F(d) 为 gcd 为 d 的倍数的对数, μ(d) 表示莫比乌斯函数F(d) ...
分类:
其他好文 时间:
2014-08-14 23:12:16
阅读次数:
322