这题的中文意思是什么?求救!!!

Cql_liliang 2011-11-27 03:39:06
Problem Description
In the case of moduling a prime number P, A is called multiplicative inverse of B if and only if A * B ≡ 1 (mod P)(0 < A, B < P), now it is a quite simple question: give you B and a prime number P,you should found that A describe above.


Input
The first line contains a single integer T, indicating the number of test cases.Each test case begin with two integer B and P (1 <= B < P <= 5000).


Output
For each test case output the answer.


Sample Input
1
5 7


Sample Output
3


...全文
157 10 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
Cql_liliang 2011-11-28
  • 打赏
  • 举报
回复
[Quote=引用 9 楼 xuyapeng1991 的回复:]

好像是让求小于B且(A*B)%p等于1的数。。p一定是素数。。
敢问楼主这是哪道题呀??
[/Quote]
不好意思看错了!!
xuyapeng1991 2011-11-27
  • 打赏
  • 举报
回复
好像是让求小于B且(A*B)%p等于1的数。。p一定是素数。。
敢问楼主这是哪道题呀??
hondely 2011-11-27
  • 打赏
  • 举报
回复
记得不错的话,应该是杭电的题目,以前 貌似也问了这个表达式,去问数论大牛吧
就是那个党伟 2011-11-27
  • 打赏
  • 举报
回复
楼上迷茫、楼主迷茫
小生也迷茫。。
哈了 2011-11-27
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 cql_liliang 的回复:]

引用 3 楼 hacqing 的回复:
a * b == n * p + 1; //(n = 1, 2, ...) &amp;&amp; (a > 0) &amp;&amp; (0< b < p)

give you B and a prime number P, you should found that A describe above.

如果B与……
[/Quote]
P是一个素数的,怎么可能是偶数.....
Cql_liliang 2011-11-27
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 hacqing 的回复:]
a * b == n * p + 1; //(n = 1, 2, ...) && (a > 0) && (0< b < p)

give you B and a prime number P, you should found that A describe above.
[/Quote]
如果B与P都是偶数的话, 那不是不存在这样的A????
shun_qizi_ran 2011-11-27
  • 打赏
  • 举报
回复
同模余
hacqing 2011-11-27
  • 打赏
  • 举报
回复

a * b == n * p + 1; //(n = 1, 2, ...) && (a > 0) && (0< b < p)

give you B and a prime number P, you should found that A describe above.

Cql_liliang 2011-11-27
  • 打赏
  • 举报
回复
这个A*B = 1(mod P)是什么意思??
hllfl 2011-11-27
  • 打赏
  • 举报
回复

65,186

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧