随笔分类 -  *数学---BSGS

摘要:Mod Tree HDU - 2815 题意:a^x≡n(mod p),求x。 BSGS模板题~ 需要注意的是n>p时显然无解 Mod Tree HDU - 2815 Mod Tree 题意:a^x≡n(mod p),求x。 BSGS模板题~ 需要注意的是n>p时显然无解 1 #include <b 阅读全文
posted @ 2017-08-28 10:30 yijiull 阅读(178) 评论(0) 推荐(0)
摘要:Clever Y POJ - 3243 题意:给a,c,b,求最小的x使得 ax≡b (mod c)。 扩展BSGS算法~ 1 #include <cstdio> 2 #include <cstring> 3 #include <iostream> 4 #include <cmath> 5 #def 阅读全文
posted @ 2017-08-18 13:25 yijiull 阅读(179) 评论(0) 推荐(0)
摘要:Discrete Logging POJ - 2417 题意:给P,B,N,求最小的L使得 BL≡N (mod P),其中P是素数。 Baby Step Giant Step 1 #include <cstdio> 2 #include <cstring> 3 #include <iostream> 阅读全文
posted @ 2017-08-17 23:39 yijiull 阅读(113) 评论(0) 推荐(0)