hdu4335(What is N?)(数论)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4335这是道数论的题目,会的人可以瞬秒。(1)先要熟悉欧拉定理:gcd(n, p) = 1时,n^(phi(p)) ≡ 1 (mod p);(2)各种条件下的n:1) n! < phi(p) ; 2)phi(p) <= n! < s!, s=min{x|x! mod phi(p)=0}; 3)n! % phi(p) = 0; 4)其他;(3)其实没多少看得懂。他人具体代码:View Code #include <cstdlib>#include <cstdio>#in
阅读全文
hdu4320(Arcane Numbers 1) (数论)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4320比较大的数字A和B,验证A的因子B是否都有。他人具体代码:View Code #include <iostream>#include <stdio.h>#include <string.h>#include <algorithm>#include <cmath>#include <queue>#include <vector>#define N 1000000using namespace std;bool h[1000
阅读全文