Badry's blog

By Badry, history, 7 years ago, In English

Hi Codeforces, I want to know if there is an efficient way to solve a^(x) = b mod(m) where x is the unknown value and m is some prime <=10^9 thanks in advance.

  • Vote: I like it
  • -8
  • Vote: I do not like it

»
7 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Here. For numbers up to 10^9, baby-step giant-step will be sufficient.

  • »
    »
    7 years ago, # ^ |
      Vote: I like it +10 Vote: I do not like it

    Thanks so much. This was very helpful.