Prepared for New Acmer
Time limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others)
Total submission (s): 7255 Accepted Submission (s): 2729
Problem description training for nearly 2 weeks, this period of time with the rehabilitation of the main, I have been closely monitoring the training situation, so far, the performance of the people are very satisfied, first of all, the majority of the players are highly motivated, followed by the training discipline, and finally, The old team also played a very good lead role, here special thanks for the DP special practice game to provide the topic and test data of the training team captain Xhd classmate.
Especially happy is, follow training team training of a group of new players performance is very good, progress is more significant, especially the training attitude greatly exceeded my expectations, I dare say, if you can so persist, absolutely promising!
Considering that the new players have not yet been trained, I will add a simple question here:
Given three positive integers, a, B, and C (a,b,c<=1000000), the result of A^b MoD C is obtained.
I hope you can experience the joy of AC in the game, absolutely tailor-made, very high treatment yo, hehe ...
Input data first contains a positive integer n, representing the number of test instances, followed by n rows of data, each containing three positive integer a,b,c.
Output for each test instance, export the computed results, one row for each instance.
Sample Input
32 3 43 3 54 4 6
Sample Output
024
Authorlcy
The source initially feels like it should not cross the border. In fact for this group: there is a negative result, so use--int64;
#include <iostream>using namespace Std;int main () {int a,b,c;int n;cin>>n;while (n--) {cin>>a>> B>>c;int sum=1;for (int i=1;i<=b;i++) {sum*=a;sum%=c;if (sum==0) break;} Cout<<sum<<endl;} return 0;}
Hangzhou Electric HDU ACM 1420 Prepared for New Acmer