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 1.00
C++ 1.00
C++14 1.00
C# 2.00
Go 2.00
Java 2.00
JavaScript 2.00
Objective-C 2.00
Perl 2.00
PHP 2.00
Python 2.00
Python3 2.00
Ruby 2.00
VB.Net 2.00

Problem Stats

157/411

Solve/Submission

Ranking

# User Language Timing
01 duronto20 Cpp14 0.06s
02 tariqiitju Cpp14 0.06s
03 feodorv Cpp14 0.06s
04 rayhan50001 Cpp14 0.07s
05 murad_al_wajed Cpp14 0.07s
06 mamunparvez Cpp14 0.08s
07 seyedssz Cpp14 0.09s
08 rana_cse Cpp14 0.10s
09 FariD Cpp 0.10s
10 joymollick Cpp14 0.11s
11 subhashis_cse Cpp 0.11s
12 sadia2427 Cpp14 0.11s
13 sazal_dev Cpp14 0.11s
14 smriad Cpp14 0.11s
15 sakib_muhit Cpp14 0.11s
16 haasib Cpp14 0.11s
17 ash12 Cpp14 0.12s
18 ammasum Cpp14 0.12s
19 onucsecu Cpp14 0.12s
20 kamran_ahmad Cpp14 0.12s
21 deder Cpp14 0.12s
22 rithu Cpp14 0.12s
23 nothing10 Cpp 0.12s
24 return_SS Cpp14 0.12s
25 AlaminJust Cpp14 0.12s
26 siamcr7 Cpp 0.12s
27 rashedul007 C 0.12s
28 joy25896 Cpp14 0.13s
29 Nusaiba Cpp14 0.13s
30 pulak_ict_mbstu Cpp 0.14s
31 ovis96 Cpp14 0.18s
32 Ishrak Cpp14 0.19s
33 anik_JU Cpp14 0.22s
34 MAHRahat Cpp14 0.23s
35 Pure_Protea Cpp14 0.25s
36 maxhasan Cpp14 0.25s
37 jayed_al_hasan Cpp14 0.26s
38 njrafi Cpp14 0.26s
39 Dragon_162 Cpp14 0.27s
40 mahbub07 Cpp14 0.27s
41 emrul Cpp14 0.27s
42 rajdipsaha Cpp 0.27s
43 Rajan_sust Cpp14 0.31s
44 md_borhan Cpp14 0.32s
45 Robinsoncruso Cpp14 0.32s
46 mhiceiuk Cpp14 0.33s
47 moshiur_cse15 Cpp14 0.34s
48 nasif2587 Cpp14 0.38s
49 yasirnabil534 Cpp14 0.40s
50 liar Cpp14 0.41s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support