Skip to content

Commit

Permalink
Add problem description at BigMod
Browse files Browse the repository at this point in the history
  • Loading branch information
fatosmorina committed May 10, 2017
1 parent 10744dc commit 11e1818
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions UVa/BigMod.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,34 @@
/**
* Calculate
* R := B
* P mod M
* for large values of B, P, and M using an efficient algorithm. (That’s right, this problem has a time
* dependency !!!.)
* Input
* The input will contain several test cases, each of them as described below. Consecutive test cases are
* separated by a single blank line.
* Three integer values (in the order B, P, M) will be read one number per line. B and P are integers
* in the range 0 to 2147483647 inclusive. M is an integer in the range 1 to 46340 inclusive.
* Output
* For each test, the result of the computation. A single integer on a line by itself.
* Sample Input
* 3
* 18132
* 17
* 17
* 1765
* 3
* 2374859
* 3029382
* 36123
* Sample Output
* 13
* 2
* 13195
*/

//https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=727&page=show_problem&problem=310

import static java.lang.Integer.parseInt;
import static java.lang.System.exit;

Expand Down

0 comments on commit 11e1818

Please sign in to comment.