Rhezo and Big Powers
Practice
3.6 (262 votes)
Approved
Easy
Math
Number theory
Ready
Problem
58% Success 16219 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
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
1.DieDie
Points:30
57 votes
Tags:
ApprovedCombinatoricsEasyException handlingMathNumber TheoryOpenProbabilityStatistics
Points:30
53 votes
Tags:
EasyMath
Points:30
64 votes
Tags:
CombinatoricsEasyMathNumber theory
Editorial
No editorial available for this problem.