Блог пользователя nirwandogra

Автор nirwandogra, 13 лет назад, По-английски

SPOJ Problem POWPOW Here is my code....... http://ideone.com/t29P3j

mod=1000000003 ,phi_mod=500000003

I have done it as follows--- --X congruent exp mod 500000003 ---X congruent 1 mod 2 ---solve for X using CRT.... ---X is (2nCn %(mod-1)) --then do ans1=powmod(X^b,mod-1) ----ans2=powmod(a^ans1,mod) print ans2 It is giving WA

  • Проголосовать: нравится
  • -8
  • Проголосовать: не нравится

»
9 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

I know this is 5 years ago, but for those who come next ... check this Quora question