![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
扩展欧几里得
ZJLORD
这个作者很懒,什么都没留下…
展开
-
C Looooops POJ - 2115
题目:点击打开链接题意: 直接公式化出来就是: Cx=(B-A)%(2^k)明显的扩欧解方程嘛,刚做了一个扩欧的总结,以为会秒A,结果 呵呵。。。确实很坑,差不多改了半个小时了,交了一面,感到绝望,怀疑人生。直接贴代码吧。还是先说一下坑吧:#include#includeusing nam原创 2017-08-11 10:47:07 · 162 阅读 · 0 评论 -
POJ 2657 Comfort
POJ Comfort (扩欧的应用) 题意: n个点顺时针围成一圈(编号1~n),初始时在1点,每次可以顺时针移动k点,n个点中有一些点有障碍物,求最小的k使得在不经过任何一个有障碍物的点就可以到达z点其实就是求 一元线性同余方程。具体做法是枚举k 找到最小的k 让 kx=z%n (kx+ny=z) 然后再考虑原创 2017-08-12 19:06:21 · 268 阅读 · 0 评论 -
Integer Sequences SGU - 140
Integer Sequences SGU - 140A sequence A is called an integer sequence of length N if all its elements A1 A2 .. AN are non-negative integers less than2 000 000 000. Consider two integer sequenc原创 2017-09-04 10:42:07 · 291 阅读 · 0 评论 -
RealPhobia HDU - 4180
RealPhobia HDU - 4180 Bert is a programmer with a real fear of floating point arithmetic. Bert has quite successfully used rational numbers to write his programs but he does not like it when the den原创 2017-09-04 14:12:06 · 280 阅读 · 0 评论 -
Jumping Joe SGU - 141
Jumping Joe SGU - 141Joe is a frog who likes to jump a lot. In fact, that's all he does: he jumps forwards and backwards on the integer axis (a straight line on which all the integer numbers, both p原创 2017-09-04 16:05:18 · 238 阅读 · 0 评论 -
LightOJ 1306 Solutions to an Equation
LightOJ 1306 Solutions to an EquationYou have to find the number of solutions of the following equation:Ax + By + C = 0Where A, B, C, x, y are integers and x1 ≤ x ≤ x2 andy1 ≤ y ≤ y2.原创 2017-08-31 09:45:30 · 557 阅读 · 0 评论