Http://mathforum.org/library/drmath/view/52343.htmlMod function and negative numbers
Date: 04/28/2000 at 11:17:09From: AnneSubject: Using the mod() function with negative numbersI work in IT - Technical Support. I am trying to sort out a problem for
Ask for the smallest X to make a ^ x = B (mod C)
Question:
[Expand the baby step giant step to solve the discrete logarithm problem]
Author aekdycoin![Normal baby step giant step][Problem model]Solution0 [Idea]We can make an equivalentX = I
Long time no write, in fact, has been doing, but not the mood to write a summary of the article, so or later to do a little bit to write it.Recently the state is very poor very bad, the water problem all can not pass, I am also drunk.Redo last
2^X mod n = 1Time limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others)Total submission (s): 13341 Accepted Submission (s): 4143Problem descriptiongive a number n, find the minimum x (x>0) that satisfies 2^x mod n = 1.Inputone
2^x mod n = 1Time limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others) total submission (s): 12605 Accepted Submission (s): 3926Problem DescriptionGive a number n, find the minimum x (x>0) that satisfies 2^x mod n = 1.InputOne
Yesterday, when learning the mathematical functions of MATLAB, the tutorial mentions that modulo (MoD) and take-rest (REM) is different, today on the Web specifically checked:
Usually the modulo operation is called the rest operation, and they
1046 a^b mod C reference time limit: 1 seconds space limit: 131072 KB score: 0 Difficulty: Basic collection attention gives 3 positive integers a B C, for A^b Mod c. For example, 3 5 8,3^5 Mod 8 = 3. Input3 positive integers a B C, separated by a
Time Limit: 2 seconds memory limit: 65536 KB
Give a number N, find the minimum X that satisfies 2 ^ x mod n = 1.
Input
One positive integer on each line, the value of N.
Output
If the minimum x exists, print a line with 2 ^ x mod n =
2^X mod n = 1Time limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others)Total submission (s): 14349 Accepted Submission (s): 4438Problem descriptiongive a number n, find the minimum x (x>0) that satisfies 2^x mod n = 1.Inputone
Problem DescriptionGiven one non-negative integer A and one positive integer b, it's very easy for us to calculate A Mod B. Here's a Mod B means the remainder of the answer after A was divided by B. For example, 7 mod 5 = 2, mod 3 = 0, 0 mod 3 =
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.