Question link: http://acm.hdu.edu.cn/showproblem.php? PID = 1, 1420
The Problem description training lasted for nearly two weeks. During this period, we focused mainly on recoverability training. I have been paying close attention to the training situation. So far, I have been quite satisfied with your performance, first, most of the team members are very enthusiastic about training, and secondly, they observe the discipline of training. Finally, the old team members also played a very leading role, I would like to thank xhd, the training team leader who provided questions and test data for this DP special exercise competition.
I'm particularly pleased that a group of new players trained by the training team have performed very well and made remarkable progress. Especially, the training attitude has greatly exceeded my expectation. I dare say, if you can stick to it like this, there is no way ahead!
Considering that new players have not been trained in the system, I will add a simple question here:
Returns the result of a ^ B mod C given three integers A, B, and C (a, B, c <= 1000000.
I hope all of you will be able to see the joy of AC in the competition, absolutely tailored, and enjoy a high level of treatment...
Input data first contains a positive integer N, indicating the number of test instances, followed by N rows of data, each line contains three positive integers A, B, C.
Output outputs the computation results for each test instance. The output of each instance occupies one row.
Sample Input
32 3 43 3 54 4 6
Sample output
024
The Code is as follows:
# Include <cstdio> int main () {_ int64 t; _ int64 A, B, C; scanf ("% i64d", & T); While (t --) {scanf ("% i64d % i64d % i64d", & A, & B, & C); _ int64 ans = 1; for (INT I = 0; I <B; I ++) {ans * = A; ans % = C;} printf ("% i64d \ n", ANS);} return 0 ;}
HDU 1420 prepared for new acmer (mathematical problem)