![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM->数学
Fate_O
Lets go
展开
-
hdu 4710
#include #include #include #include using namespace std; long long gcd(long long a,long long b) { return b ? gcd(b, a % b) : a; } long long Count(long long n,long long a,long lo原创 2013-09-09 14:06:50 · 561 阅读 · 0 评论 -
街区的最短路径 nyist7
街区最短路径问题 时间限制:3000 ms | 内存限制:65535 KB 难度:4 描述一个街区有很多住户,街区的街道只能为东西、南北两种方向。 住户只可以沿着街道行走。 各个街道之间的间隔相等。 用(x,y)来表示住户坐在的街区。 例如(4,20),表示用户在东西方向第4个街道,南北方向第20个街道。 现在要建一个邮局,使得各个住户到原创 2013-10-02 18:33:53 · 542 阅读 · 0 评论 -
数学->hdu 2973
YAPTCHA Time Limit:5000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 2973 Description The math department has been having problems lately. Due原创 2013-10-12 18:37:26 · 651 阅读 · 0 评论 -
数学->hdu 3628 HeavenHelix
HeavenHelix Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 3628 Description It's said that MJ was invited to perform for the God.原创 2013-10-12 18:21:31 · 617 阅读 · 0 评论 -
数学-三分->HDU 3714 Error Curves
Error Curves Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 3714 Description Josephina is a clever girl and addicted to Machine L原创 2013-10-13 21:26:26 · 593 阅读 · 0 评论 -
数学-> YY POJ 1338
Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u Submit Status Practice POJ 1338 Description Ugly numbers are numbers whose only prime factors are 2, 3 or 5. T原创 2013-10-13 22:07:30 · 548 阅读 · 0 评论 -
数学-三分->讲解
原文:http://hi.baidu.com/vfxupdpaipbcpuq/item/81b21d1910ea729c99ce33db 二分法作为分治中最常见的方法,适用于单调函数,逼近求解某点的值。但当函数是凸性函数时,二分法就无法适用,这时三分法就可以“大显身手”~~ 如图,类似二分的定义Left和Right,mid = (Le转载 2013-10-13 21:31:58 · 619 阅读 · 0 评论 -
求逆元步骤总结
求逆元方法总结 在MOD的情况下, (a*b/c ) %MOD 不能直接 / c 来求,需要找到一个数 inv 使得 inv * c % MOD = 1 。 这样 (a*b / c) % MOD = (a * b * inv) % MOD; 性质: 逆元是积性函数 存在 a*b = c ,那么 inv[c] = inv[a] * inv[b] %转载 2014-08-18 14:12:15 · 1108 阅读 · 0 评论 -
扩展欧几里得
static long x, y; public static long exgcd(long a, long b) { if (b == 0) { x = 1; y = 0; return a; } long r = exgcd(b, a % b); long t = x; x = y; y = t - a / b * y; return原创 2014-08-03 11:11:53 · 656 阅读 · 0 评论