8000 Add problem description at BigMod · zwxalgorithm/interviews@11e1818 · GitHub
[go: up one dir, main page]

Skip to content

Commit 11e1818

Browse files
committed
Add problem description at BigMod
1 parent 10744dc commit 11e1818

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

UVa/BigMod.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,34 @@
1+
/**
2+
* Calculate
3+
* R := B
4+
* P mod M
5+
* for large values of B, P, and M using an efficient algorithm. (That’s right, this problem has a time
6+
* dependency !!!.)
7+
* Input
8+
* The input will contain several test cases, each of them as described below. Consecutive test cases are
9+
* separated by a single blank line.
10+
* Three integer values (in the order B, P, M) will be read one number per line. B and P are integers
11+
* in the range 0 to 2147483647 inclusive. M is an integer in the range 1 to 46340 inclusive.
12+
* Output
13+
* For each test, the result of the computation. A single integer on a line by itself.
14+
* Sample Input
15+
* 3
16+
* 18132
17+
* 17
18+
* 17
19+
* 1765
20+
* 3
21+
* 2374859
22+
* 3029382
23+
* 36123
24+
* Sample Output
25+
* 13
26+
* 2
27+
* 13195
28+
*/
29+
130
//https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=727&page=show_problem&problem=310
31+
232
import static java.lang.Integer.parseInt;
333
import static java.lang.System.exit;
434

0 commit comments

Comments
 (0)
0