
欧拉函数、定理
Error Man
我是菜逼
展开
-
Codeforces 1182 E. Product Oriented Recurrence(矩阵快速幂 + 欧拉降幂 + 快速幂)
E. Product Oriented RecurrenceLetfx=c2x−6⋅fx−1⋅fx−2⋅fx−3fx=c2x−6⋅fx−1⋅fx−2⋅fx−3forx≥4x≥4.You have given integersnn,f1f1,f2f2,f3f3, andcc. Findfnmod(109+7)fnmod(109+7).InputThe only li...原创 2019-07-23 20:20:23 · 633 阅读 · 0 评论 -
HDU - 1395 2^x mod n = 1(欧拉定理)
2^x mod n = 1Give a number n, find the minimum x(x>0) that satisfies 2^x mod n = 1.InputOne positive integer on each line, the value of n.OutputIf the minimum x exists, print a line wit...原创 2019-07-17 11:37:08 · 288 阅读 · 0 评论 -
HDU - 2588 GCD (数论,欧拉函数,gcd)
GCDThe greatest common divisor GCD(a,b) of two positive integers a and b,sometimes written (a,b),is the largest divisor common to a and b,For example,(1,2)=1,(12,18)=6.(a,b) can be easily found by...原创 2019-07-20 10:28:29 · 254 阅读 · 0 评论 -
HDU - 2837 Calculation (欧拉降幂,a ^ (b ^ c)以及更高)
CalculationAssume that f(0) = 1 and 0^0=1. f(n) = (n%10)^f(n/10) for all n bigger than zero. Please calculate f(n)%m. (2 ≤ n , m ≤ 10^9, x^y means the y th power of x).InputThe first line contai...原创 2019-07-21 16:24:49 · 289 阅读 · 0 评论 -
2019 icpc 南京网络赛 B.super_log (广义欧拉降幂,a^(a^a...),[b个a])
题目连接题意: 输入a,b,ma,b,ma,b,m。求 aaaaa^{a^{a^a}}aaaa ,共有 bbb 个 aaa, mod mmod\ mmod m 的值。思路:就是广义的欧拉降幂公式,运用在快速幂里面,不然会wa注意的点: mmm 可以为 111,bbb 可以为 000。当 b==0b==0b==0时不能直接特判,还要考虑 mmm 的值。 递归时候的...原创 2019-09-01 20:14:48 · 205 阅读 · 0 评论