#P0071. [模板] 乘法逆元
[模板] 乘法逆元
Description
模板——乘法逆元。
给定正整数 与 ,求 中的所有数在模 意义下的乘法逆元。
Format
Input
一行两个正整数 与 。
Output
行,第 行一个正整数,表示 在模 意义下的乘法逆元。
Samples
10 13
1
7
9
10
8
11
2
5
3
4
Limitation
,
为质数。
Related
In following homework:
模板——乘法逆元。
给定正整数 n 与 p,求 1∼n 中的所有数在模 p 意义下的乘法逆元。
一行两个正整数 n 与 p。
n 行,第 i 行一个正整数,表示 i 在模 p 意义下的乘法逆元。
10 13
1
7
9
10
8
11
2
5
3
4
1≤n≤3×106, n<p<20000528
p 为质数。
In following homework:
By signing up a 启智 | CDEZ OJ universal account, you can submit code and join discussions in all online judging services provided by us.