1624--【USACO】Cruel Math Teacher, I(残酷的数学老师I)

1624: 【USACO】Cruel Math Teacher, I(残酷的数学老师I)


时间限制: 1.000 Sec  内存限制: 64 MB
提交: 84  解决: 20
[提交] [状态] [报告] [命题人:]

题目描述

Bessie has returned to 8th grade in order to finish her diploma. Her cruel math teacher wants the students to calculate "powers of integers". An integer power is the resultant integer when some number N (1 <= N <= 2,000,000,000) is multiplied by itself over and over P times (1 <= P <= 100,000). By way of example, 2 to the power 3 = 2 * 2 * 2 (three times) = 8. Similarly, 123456 to the power 88 = 123456 * 123456 * ... * 123456 (88 times) = 1129987770413559019467963153621658978635389622595924947762339599136126 3387265547320084192414348663697499847610072677686227073640285420809119 1376617325522768826696494392126983220396307144829544079751988205731569 1498433718478969549886325738202371569900214092289842856905719188890170 0772424218248094640290736200969188059104939824466416330655204270246371 3699112106518584413775333247720509274637795508338904731884172716714194 40898407102819460020873199616 when printed 70 digits per line. Write a program to calculate the Pth power of an integer N. The answer is guaranteed to be no longer than 15,000 digits. Print your answer 70 digits per line (except the last line which might be shorter). Do not print leading zeroes, of course.

贝西为了完成毕业证书已经回到八年级。她残酷的数学老师希望学生们计算“整数的力量”。整数幂是当某个数n(1<=n<=2000000000)乘以它自身的p次(1<=p<=100000)时的合成整数。举例来说,2的3次幂=2*2*2(三次)=8。同样,123456的88次幂=123456*123456**123456(88次)=1129987770413559019467963153621658978635389622559249477762339599136126 33872655473200844192414348663697499847610072677686227073640285420809119 13766173255268826696494392126983220396073144829544079751988205731569 1498433718478969549886325738237156900214092289842856905719188890170 0772421824809640290736200969188059104939824466416330655204270246371 3699112106518584413775333247772050927463779550833894731884172716714194 408984007102819460020873199616每行打印70位时。编写一个程序来计算整数n的p次幂。保证答案不超过15000位。每行打印您的答案70位(可能较短的最后一行除外)。当然,不要打印前导零。

输入

* Line 1: Two space-separated integers: N and P

*第1行:两个空格分隔的整数:n和p

输出

* Lines 1..?: A single integer that is the result of the calculation. Print 70 digits per line except potentially for the last line, which might be shorter.

*行1…?:是计算结果的单个整数。每行打印70位数字,但最后一行可能较短。

样例

输入  复制
2 15
输出  复制
32768

提示

INPUT DETAILS: Calculate 2 to the 15th power.

来源/分类