CodeForces 906D (Euler descending)

Power Tower

• the meaning of problems

Request $ w_ {l} ^ {w_ {l + 1} ^ {w_ {l + 2} ^ {w_ {l + 3} ^ {w_ {l + 4} ^ {w_ {l + 5} ^ {.. . ^ {w_ {r}}}}}}}} $ value modulo m

• ideas

 These two problems with almost God and the collection of the correct usage   super_log

The difference is that

① range number becomes, but one level is recursive, until finally only one return $ w_ {r} \ or \ \ varphi (m) = 1 $

② fixed for a set of data m, m of all the Euler function $ \ varphi (m), \ varphi (\ varphi (m)) ... $ out can be pretreated

  Eliminating the need for a calculation times and improve efficiency 

• Code

CodeForces 906D.cpp

Guess you like

Origin www.cnblogs.com/MMMinoz/p/11455069.html