随笔分类 -  简单数论

摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5531 Problem Description Archaeologists find ruins of Ancient ACM Civilization, and they want to rebuil 阅读全文
posted @ 2019-09-10 21:56 cherish__lin 阅读(218) 评论(0) 推荐(0)
摘要:扩展欧几里得能求出形如a*x+b*y=gcd(a,b)的通解x,y。 我们设 a1*x1+b1*y1=gcd(a,b) (1) a2*x2+b2*y2=gcd(a,b) (2) 并且a2=b1,b2=a1%b1=a1-(a1/b1*b1) 则(1)(2)相等可得a1*x2+b1*y1=b1*x2+[ 阅读全文
posted @ 2019-07-04 19:49 cherish__lin 阅读(271) 评论(0) 推荐(0)