![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数学
zhenggy_
爱生活,爱编程
展开
-
当我真正理解了扩展欧几里得定理
当我真正理解了扩展欧几里得定理转载:http://www.cnblogs.com/ka200812/archive/2011/09/02/2164404.html首先、扩展欧几里得定理:对于两个不全为0的整数a、b,必存在一组解x,y,使得ax+by==gcd(a,b);实现如下:int gcd(int a,int b){ int t,d;转载 2015-03-30 15:32:16 · 2701 阅读 · 0 评论 -
UVA 11300 Spreading the Wealth
#include #include #include using namespace std;#define MAX 1001000long long a[MAX], c[MAX];int main(){ int n; long long sum, v, x, ans; while(scanf("%d", &n) != -1) {原创 2015-02-27 15:46:48 · 437 阅读 · 0 评论 -
poj 3070 矩阵快速幂
poj3070#include #include using namespace std;#define M_H 2#define M_L 2typedef struct ma{ int h, l; int a[M_H][M_L];}ma;ma need, anser;void init(){ need.h=2; need.l=2; a原创 2015-04-16 21:37:31 · 503 阅读 · 0 评论 -
POJ - 1061 青蛙的约会
#include using namespace std;#define LL __int64LL x0, y0;int gcd(LL a, LL b){ LL flag, r; if(b==0){ x0 = 1; y0 = 0; return a; } r = gcd(b, a%b); flag原创 2015-03-30 21:30:20 · 657 阅读 · 0 评论 -
开锁魔法II 哈尔滨理工大学第五届ACM程序设计竞赛
开锁魔法II 哈尔滨理工大学第五届ACM程序设计竞赛原创 2015-03-30 17:42:03 · 1198 阅读 · 0 评论 -
poj 3070 Fibonacci 矩阵快速幂
#include #include using namespace std;#define M_H 2#define M_L 2typedef struct ma{ int h, l; int a[M_H][M_L];}ma;ma need, anser;void init(){ need.h=2; need.l=2; anser.h=2原创 2015-05-05 14:23:07 · 388 阅读 · 0 评论