欧几里得
文章平均质量分 72
smmrSangria
这个作者很懒,什么都没留下…
展开
-
2017 ACM-ICPC 亚洲区(西安赛区)网络赛_Coin
#include #include #include #include #include #define INF 0x3f3f3f3f #define rep0(i, n) for (int i = 0; i < n; i++) #define rep1(i, n) for (int i = 1; i <= n; i++) #define rep_0(i, n) for (int i =原创 2017-10-06 18:54:03 · 377 阅读 · 0 评论 -
zoj3609_Modular Inverse(扩展欧几里得/naked)
#include #include using namespace std; /** a * x ≡ 1(mod m) 求最小的正的乘法逆元 s = m / gcd(a, m) x = x0 + s * t x = (x % s + s) % s 当x为负时 x % s = x - x / s * s HINT: if x == 0 x = s; */ int exgcd(i原创 2017-10-01 11:14:01 · 249 阅读 · 0 评论 -
poj1061_青蛙的约会(扩展欧几里得/naked)
#include #include #include #include #include #define INF 0x3f3f3f3f #define rep0(i, n) for (int i = 0; i < n; i++) #define rep1(i, n) for (int i = 1; i <= n; i++) #define rep_0(i, n) for (int i =原创 2017-10-01 16:40:28 · 288 阅读 · 0 评论 -
poj2142_The Balance
#include #include #include #include #include #define INF 0x3f3f3f3f #define rep0(i, n) for (int i = 0; i < n; i++) #define rep1(i, n) for (int i = 1; i <= n; i++) #define rep_0(i, n) for (int i =原创 2017-10-02 12:13:20 · 476 阅读 · 0 评论