01 2012 档案

扩展欧几里德算法
摘要:问题:对于正整数a,b,求整数x,y满足: ax+by=gcd(a,b) 解法:ExtandedGCD 已知gcd(a,b)=gcd(b,a mod b); 设gcd(a,b)=d 假设已求出x1,y1满足bx1+(a mod b)y1=d(*) 因为a mod b=a-(a div b)*b(**) (**)代入(*)得: ay1+(x1-(a div b)*y1)b=d 所以x=y1 y=x1... 阅读全文

posted @ 2012-01-30 22:44 爱宝宝 阅读(172) 评论(0) 推荐(0)

Everyday
摘要:给大家推荐首歌EveryDAY Troy&GabrialaOnce in a lifetimeMeans there's no second chanceSo I believe that you and meShould grab it while we canMake it last foreverAnd never give it backIt's our turnAnd I'm loving where we're atBecause this moment's really all we haveEveryday of our live 阅读全文

posted @ 2012-01-28 14:32 爱宝宝 阅读(127) 评论(0) 推荐(0)

判断两线段标准相交
摘要:1 { 2 二维线段标准相交问题 3 } 4 Program LineIntersect; 5 6 const 7 precision=1E-6; 8 9 Type 10 11 point=record12 x,y:double;13 end;14 15 Tdbl=-1..1;16 17 var18 p:array[1..4] of point;19 i:longint;20 Function dblcmp(d:double):Tdbl;//注意这里相当于一个过滤器,函数值只有三种-1,0,121 begin22 if abs(d)<precision t... 阅读全文

posted @ 2012-01-28 10:56 爱宝宝 阅读(122) 评论(0) 推荐(0)

启航了!
摘要:从今天起,我就在这里开始我的OI之旅了!1 Program RPplus;2 3 var4 rp:double;5 6 begin7 while 1=1 do8 inc(rp,maxlongint);9 end. 阅读全文

posted @ 2012-01-28 10:49 爱宝宝 阅读(101) 评论(0) 推荐(0)

< 2025年7月 >
29 30 1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31 1 2
3 4 5 6 7 8 9

导航

点击右上角即可分享
微信分享提示