Safe Power (Non-negative Exponent)

Python Easy 5 views
Back to Questions

Problem Description

Read two integers a and b. Output a^b modulo 1000000007. If b is negative or input invalid, output ERROR.

Input Format

One line: a b.

Output Format

One integer or ERROR.

Sample Test Case

Input:
2 10
Output:
1024

Constraints

|a|

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next