![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
扩展欧几里得
文章平均质量分 86
zzuzxy
牛顿说:“我不知道世人怎样看我,但我自己以为我不过像一个在海边玩耍的孩子,不时为发现比寻常更为美丽的一块卵石或一片贝壳而沾沾自喜,至于展现在我面前的浩翰的真理海洋,却全然没有发现。”
展开
-
C. Ray Tracing
Intel Code Challenge Final Round (div.1 + div.2 combined) editorial C. Ray Tracing time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard outputT转载 2017-08-07 22:47:03 · 204 阅读 · 0 评论 -
欧几里得扩展
源网址 欧几里得扩展证明(自我感觉最好懂得一种写法) ① ,当b = 0 时,gcd(a, b) = a , 此时 x = 1, y = 0;② ,当a∗b≠0a∗b≠0 a * b \not = 0 时,设 a * x + b * y = gcd(a, b); (1)b * x0 + (a % b) * y0 = gcd( b, a % b); (2)由朴素的欧几...转载 2017-08-06 21:50:16 · 390 阅读 · 0 评论 -
青蛙的约会 POJ - 1061
青蛙的约会 POJ - 1061扩展欧几里得#include <iostream>#include <cstdio>using namespace std;long long t, p, c;void extend_euild(int a, int b){ if(b == 0) { t = 1; p = 0; c = a;原创 2017-08-26 20:57:44 · 375 阅读 · 0 评论 -
X问题 HDU - 1573& Strange Way to Express Integers POJ - 2891
[toc] X问题 HDU - 1573& Strange Way to Express Integers POJ - 28911. 题意一个数模mimim_i 等于 aiaia_i,第一个问题是求最小的,第二个问题是求x<=n有多少个2. 分析合并两个模数 假设 y=a1...原创 2017-10-07 23:13:51 · 256 阅读 · 0 评论