
扩展欧几里德算法
文章平均质量分 75
DTL66
细节决定成败
展开
-
欧几里德及扩展欧几里德算法总结
1.欧几里德: 应用:用于求a,b的最大公约数:递归解法:__int64 gcd(__int64 a,__int64 b)//求解a,b的最大公约数 { if(a%b==0)//b为最大公约数 return b; return gcd(b,a%b);//gcd(a,b)=gcd(b,a%b) } 非递归解法:__int64 gcd(__int64 a,__in原创 2016-07-31 15:42:08 · 362 阅读 · 0 评论 -
POJ-1016 青蛙的约会
C - F是签到题Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticeOpenJ_Bailian 1061 Description 两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西原创 2016-07-31 17:49:19 · 1396 阅读 · 0 评论 -
POJ 2891 Strange Way to Express Integers 【中国剩余定理线性模方程合并(模板)】
Strange Way to Express IntegersTime Limit:1000MS Memory Limit:131072KB 64bit IO Format:%lld & %llu DescriptionElina is reading a book written by Rujia Liu, which introduces a strange way to expr原创 2016-08-23 12:19:29 · 452 阅读 · 0 评论 -
POJ-1006 Biorhythms 【中国剩余定理模板】
C - BiorhythmsTime Limit:1000MS Memory Limit:10000KB 64bit IO Format:%lld & %lluSubmitStatusPractice Description人生来就有三个生理周期,分别为体力、感情和智力周期,它们的周期长度为23天、28天和33天。每一个周期中有一天是高峰。在高峰这天,人原创 2016-08-21 22:02:10 · 445 阅读 · 0 评论 -
POJ 2115 C Looooops【Exgcd+位移(LL)】
F - C LooooopsTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu DescriptionA Compiler Mystery: We are given a C-language style for loop of type for (variable = A; variable !原创 2016-09-03 09:47:23 · 356 阅读 · 0 评论 -
HDU 2669 【Exgcd正宗模板】
RomanticTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u DescriptionThe Sky is Sprite. The Birds is Fly in the Sky. The Wind is Wonderful. Blew Throw the Trees Tree原创 2016-09-03 10:29:26 · 547 阅读 · 0 评论