上一页 1 2 3 4 5 6 7 8 9 ··· 15 下一页
摘要: 一、扩展欧几里德算法:已知a, b求解一组x,y,使它们满足等式: ax+by =gcd(a, b) =d(解一定存在,根据数论中的相关定理)。扩展欧几里德常用在求解模线性方程及方程组中。证明:ax+by=gcd(a,b);1. (1) a = 0,ax+by = gcd(a,b) = gcd(0,... 阅读全文
posted @ 2015-10-25 20:23 午夜阳光~ 阅读(2106) 评论(1) 推荐(1) 编辑
摘要: ax+by+c=0可以转化为ax+by=-c;可以用扩展欧几里德算法来求ax1+by1=gcd(a,b)来求出x1,y1此时gcd(a,b)不一定等于-c,假设-c=gcd(a,b)*z,可得z=-c/gcd(a,b);则ax+by=-c (ax1+by1)*z=gcd(a,b)z; ... 阅读全文
posted @ 2015-10-25 18:05 午夜阳光~ 阅读(271) 评论(0) 推荐(0) 编辑
摘要: https://icpcarchive.ecs.baylor.edu/index.phpoption=com_onlinejudge&Itemid=8&page=show_problem&problem=5159题目大意:n个队伍参加比赛,有m个队伍晋级,n个队伍有n-1场比赛,每两个队伍之间都有一... 阅读全文
posted @ 2015-10-23 18:58 午夜阳光~ 阅读(443) 评论(0) 推荐(0) 编辑
摘要: 读入n个整数定义栈数据类型定义栈的初始化、判空、判满、入栈、出栈函数写一主函数,完成n个数的读入和逆序输出#include#define stacksize 100#define OK 1#define ERROR 0#define Overflow -1typedef int Status;typ... 阅读全文
posted @ 2015-10-16 15:43 午夜阳光~ 阅读(131) 评论(0) 推荐(0) 编辑
摘要: B -Kefa and CompanyTime Limit:2000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeCodeForces 580BDescriptionKefa wants to cele... 阅读全文
posted @ 2015-10-14 17:46 午夜阳光~ 阅读(362) 评论(0) 推荐(0) 编辑
摘要: https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=5091题目大意:n个人编号从1到n,m条关系,a找b帮忙或b找a帮忙需要花费c元,当然a可以... 阅读全文
posted @ 2015-10-10 17:08 午夜阳光~ 阅读(199) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4815DescriptionA crowd of little animals is visiting a mysterious laboratory � The Deep Lab of SYSU.“Are you... 阅读全文
posted @ 2015-10-10 15:35 午夜阳光~ 阅读(431) 评论(0) 推荐(0) 编辑
摘要: https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=5089题目大意:给n个木棒,用这n个木棒组成多个三角形,求这些三角形面积和的最大值,如果一个... 阅读全文
posted @ 2015-10-09 19:07 午夜阳光~ 阅读(255) 评论(0) 推荐(0) 编辑
摘要: https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=5085题目大意:给n个人以及每个人的名字s和他能杀死的敌人数m,将这些人按能杀死的敌人数进行... 阅读全文
posted @ 2015-10-09 17:55 午夜阳光~ 阅读(194) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#define OK 1#define ERROR 0typedef int Status;typedef struct Lnode{ int data; struct Lnode *next;}Lnode, *Linklist;int m... 阅读全文
posted @ 2015-10-09 15:51 午夜阳光~ 阅读(117) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 15 下一页