POWAH! UNLIMITED POWAH! Problem Emperor Palpatine has the vicious ability to shoot force lightning out of his fingers. The way this works is actually quite predictable through some mathematical computation. Depending on how much Palpatine has exerted himself that day, he has a certain amount of energy E stored. Once he starts shooting lightning, the power P of his lightning is equal to 1. After each millisecond, Pincreases by a factor of E that is to say, we multiply P by E to get the new P. Given Palpatine's initial energy E and the number of milliseconds he has been shooting lightning out of his fingers, compute the power P of his lightning. Since this may be very large, output P modulo 107. 24 Input Format Input consists of a single test case containing a line with two integers E and T separated by a space indicating the energy and the time elapsed in milliseconds. Constraints 1≤E≤ 10¹2 0≤T≤ 10¹2 Output Format Output consists of one line containing Palpatine's power P after T milliseconds modulo 107. Sample Input 0 Sample Output 0 16 Sample Input 1 Submissions 10 4 Discussions Sample Output 1 10000
POWAH! UNLIMITED POWAH! Problem Emperor Palpatine has the vicious ability to shoot force lightning out of his fingers. The way this works is actually quite predictable through some mathematical computation. Depending on how much Palpatine has exerted himself that day, he has a certain amount of energy E stored. Once he starts shooting lightning, the power P of his lightning is equal to 1. After each millisecond, Pincreases by a factor of E that is to say, we multiply P by E to get the new P. Given Palpatine's initial energy E and the number of milliseconds he has been shooting lightning out of his fingers, compute the power P of his lightning. Since this may be very large, output P modulo 107. 24 Input Format Input consists of a single test case containing a line with two integers E and T separated by a space indicating the energy and the time elapsed in milliseconds. Constraints 1≤E≤ 10¹2 0≤T≤ 10¹2 Output Format Output consists of one line containing Palpatine's power P after T milliseconds modulo 107. Sample Input 0 Sample Output 0 16 Sample Input 1 Submissions 10 4 Discussions Sample Output 1 10000
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter10: Classes And Data Abstraction
Section: Chapter Questions
Problem 19PE
Related questions
Question
PUP Problem Set
Can be answered in Java 8, C++14, or Pypy 3
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole