DCP-23: Another Bigmod Problem Back to All Problems

Hard Math > Modular Arithmetic


Given A, B and C, find the value of (A^B)%C. Input: ------ First line will contain a single integer T (T<1000) indicating number of test case. After that, T lines will follow with three positive integers A, B and C. (A,B,C<=10^18) Output: ------- For each test case, print a single line containing the case number and the value of (A^B)%C. See the sample case. Sample Input ------------ 3 12 43 123 1231 123 1000 12345 123456789 123456789012345 Sample Output ------------- Case 1: 6 Case 2: 991 Case 3: 59212459031520


Problem Setter:

Mohammad Samiul Islam

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C/C++ 1.00
Java 2.00
C# 2.00
PHP 2.00

Problem Stats

120/332

Solve/Submission

Ranking

# User Language Timing
01 duronto20 Cpp 0.06s
02 tariqiitju Cpp 0.06s
03 rayhan50001 Cpp 0.07s
04 murad_al_wajed Cpp 0.07s
05 mamunparvez Cpp 0.08s
06 seyedssz Cpp 0.09s
07 sakib_muhit Cpp 0.11s
08 haasib Cpp 0.11s
09 sazal_dev Cpp 0.11s
10 sadia2427 Cpp 0.11s
11 onucsecu Cpp 0.12s
12 ash12 Cpp 0.12s
13 Nusaiba Cpp 0.13s
14 joy25896 Cpp 0.13s
15 Ishrak Cpp 0.19s
16 anik_JU Cpp 0.22s
17 mahrahat Cpp 0.23s
18 Pure_Protea Cpp 0.25s
19 maxhasan Cpp 0.25s
20 jayed_al_hasan Cpp 0.26s
21 emrul Cpp 0.27s
22 md_borhan Cpp 0.32s
23 Robinsoncruso Cpp 0.32s
24 mhiceiuk Cpp 0.33s
25 moshiur_cse15 Cpp 0.34s
26 nasif2587 Cpp 0.38s
27 yasirnabil534 Cpp 0.40s
28 liar Cpp 0.41s
29 Zeronfinity Cpp 0.43s
30 swapnil Cpp 0.43s
31 anowar1112 Cpp 0.45s
32 ImagineWarrior Cpp 0.47s
33 prantacse14 Cpp 0.48s
34 ahqmrf Cpp 0.48s
35 drifter Cpp 0.49s
36 jayanto Cpp 0.49s
37 froghramar Cpp 0.50s
38 SKL12 Cpp 0.50s
39 ssavi Cpp 0.51s
40 Koushik_12 Cpp 0.51s
41 as_couple Cpp 0.52s
42 nazmulasha Cpp 0.54s
43 rashed_cse Cpp 0.58s
44 Masum_ice Cpp 0.60s
45 Unseen Cpp 0.62s
46 Islam_Rafat Cpp 0.62s
47 NOxBODY Cpp 0.64s
48 KIRIN_36 Cpp 0.65s
49 r3l0ad3d Cpp 0.66s
50 Zexon Cpp 0.66s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support