Rhezo and Big Powers
Practice
3.6 (262 votes)
Approved
Easy
Math
Number theory
Ready
Problem
58% Success 16195 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code

Rhezo likes numbers of the form \(A^B\). But computing \(A^B\), for any 2 numbers A and B is a hard task for him. He would like you to help him out in this.

Input:
First line of input contains a single integer A. Second line contains the integer B.

Output:
Help Rhezo find \(A^B\). As this number can be large, print it modulo \(10^9+7\).

Constraints:

  • \( 1 \le A \le 10^9 \)
  • \( 1 \le B \le 10^{10^5} \)

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
64 votes
Tags:
CombinatoricsEasyMathNumber theory
Points:30
29 votes
Tags:
ApprovedEasyMathNumber theory
Points:30
24 votes
Tags:
AlgorithmsApprovedEasyOpen
Editorial

No editorial available for this problem.