Fast Power Mod Function

Python Hard 3 views
Back to Questions

Problem Description

Read a b m, write function modpow(a,b,m) using binary exponent and output a^b mod m.

Input Format

One line: a b m.

Output Format

One integer ans.

Sample Test Case

Input:
2 10 1000
Output:
24

Constraints

0

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next