锘??xml version="1.0" encoding="utf-8" standalone="yes"?>色综合久久天天综线观看,人妻无码久久精品,一级做a爰片久久毛片免费陪http://www.shnenglu.com/luyulaile/category/10537.htmlI canzh-cnFri, 13 Apr 2012 10:35:44 GMTFri, 13 Apr 2012 10:35:44 GMT60璐歸┈灝忓畾鐞?/title><link>http://www.shnenglu.com/luyulaile/archive/2012/04/11/170856.html</link><dc:creator>luis</dc:creator><author>luis</author><pubDate>Tue, 10 Apr 2012 23:16:00 GMT</pubDate><guid>http://www.shnenglu.com/luyulaile/archive/2012/04/11/170856.html</guid><wfw:comment>http://www.shnenglu.com/luyulaile/comments/170856.html</wfw:comment><comments>http://www.shnenglu.com/luyulaile/archive/2012/04/11/170856.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/luyulaile/comments/commentRss/170856.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/luyulaile/services/trackbacks/170856.html</trackback:ping><description><![CDATA[<h2>    <span style="font-family: arial, 瀹嬩綋, sans-serif; font-size: 14px; font-weight: normal; line-height: 25px; background-color: #ffffff; ">鍋囧p鏄川鏁幫紝涓?a,p)=1錛岄偅涔?a^(p-1) ≡1錛坢od p錛?<br />       鍋囧p鏄川鏁幫紝涓攁,p浜掕川錛岄偅涔?a鐨?p-1)嬈℃柟闄や互p鐨勪綑鏁版亽絳変簬1</span> <br />鍘嗗彶</h2><span style="font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">銆銆涓庤垂椹皬瀹氱悊鐩稿叧鐨勬湁涓涓?/span><a target="_blank" style="color: #136ec2; font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">涓浗</a><span style="font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">鐚滄兂錛岃繖涓寽鎯蟲槸涓浗鏁板瀹舵彁鍑烘潵鐨勶紝鍏跺唴瀹逛負(fù)錛氬綋涓斾粎褰?^(p-1錛?#8801;1(mod p錛夛紝p鏄竴涓川鏁般?/span><div style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; font-family: arial, 瀹嬩綋, sans-serif; background-color: #ffffff; "></div><span style="font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">銆銆鍋囧p鏄竴涓川鏁扮殑璇濓紝鍒?^(p-1錛?#8801;1(mod p錛夋垚绔嬶紙榪欐槸璐歸┈灝忓畾鐞嗙殑涓涓壒孌婃儏鍐碉級鏄鐨勩備絾鍙嶈繃鏉ワ紝鍋囧2^(p-1錛?#8801;1(mod p錛夋垚绔嬮偅涔坧鏄竴涓川鏁版槸涓嶆垚绔嬬殑錛堟瘮濡?41絎﹀悎涓婅堪鏉′歡浣嗕笉鏄竴涓川鏁幫級銆傚洜姝ゆ暣涓潵璇磋繖涓寽鎯蟲槸閿欒鐨勩備竴鑸涓轟腑鍥芥暟瀛﹀鍦ㄨ垂椹墠2000騫寸殑鏃跺欏氨宸茬粡璁よ瘑涓浗鐚滄祴浜嗭紝浣嗕篃鏈変漢璁や負(fù)瀹為檯涓婁腑鍥界寽嫻嬫槸1872騫存彁鍑虹殑錛岃涓哄畠鏃╁氨涓轟漢鎵鐭ユ槸鍑轟簬涓涓瑙c?/span><div style="height: 30px; line-height: 30px; overflow-x: hidden; overflow-y: hidden; font-family: arial, 瀹嬩綋, sans-serif; background-color: #ffffff; "></div><h2><span editable-title"="" data-edit-id="263807:263807:2" style="font-size: 12px; float: right; display: block; margin-top: 10px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: #3366cc; font-weight: normal; "><a style="color: #136ec2; height: 15px; line-height: 16px; background-image: url(http://img.baidu.com/img/baike/bk-split-icons.png); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; display: block; width: 52px; padding-left: 18px; background-position: 0% -108px; background-repeat: no-repeat no-repeat; ">緙栬緫鏈</a></span><a name="2" style="text-decoration: underline; color: rgb(19, 110, 194); "></a><a name="sub263807_2" style="text-decoration: underline; color: rgb(19, 110, 194); "></a>璇佹槑</h2><span style="font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">銆銆</span><strong style="font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">涓銆佸噯澶囩煡璇嗭細(xì)</strong><div style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; font-family: arial, 瀹嬩綋, sans-serif; background-color: #ffffff; "></div><span style="font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">銆銆</span><strong style="font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">寮曠悊1錛?a target="_blank" style="color: #136ec2; ">鍓╀綑緋?/a>瀹氱悊2</strong><div style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; font-family: arial, 瀹嬩綋, sans-serif; background-color: #ffffff; "></div><span style="font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">銆銆鑻,b,c涓轟換鎰?涓暣鏁幫紝m涓烘鏁存暟錛屼笖錛坢,c)=1錛屽垯褰揳c≡bc(mod m錛夋椂錛屾湁a≡b(mod m)</span><div style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; font-family: arial, 瀹嬩綋, sans-serif; background-color: #ffffff; "></div><span style="font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">銆銆璇佹槑錛歛c≡bc(mod m錛夊彲寰梐c–bc≡0(mod m錛夊彲寰楋紙a-b)c≡0(mod m錛夊洜涓猴紙m,c)=1鍗砿,c浜掕川錛宑鍙互綰﹀幓錛宎–b≡0(mod m錛夊彲寰梐≡b(mod m)</span><div style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; font-family: arial, 瀹嬩綋, sans-serif; background-color: #ffffff; "></div><span style="font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">銆銆</span><strong style="font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">寮曠悊2錛庡墿浣欑郴瀹氱悊5</strong><div style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; font-family: arial, 瀹嬩綋, sans-serif; background-color: #ffffff; "></div><span style="font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">銆銆鑻涓烘暣鏁頒笖m>1,a[1],a[2],a[3],a[4]錛?#8230;a[m]涓簃涓暣鏁幫紝鑻ュ湪榪檓涓暟涓換鍙?涓暣鏁板m涓嶅悓浣欙紝鍒欒繖m涓暣鏁板m鏋勬垚瀹屽叏鍓╀綑緋匯?/span><div style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; font-family: arial, 瀹嬩綋, sans-serif; background-color: #ffffff; "></div><span style="font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">銆銆璇佹槑錛氭瀯閫爉鐨勫畬鍏ㄥ墿浣欑郴錛?,1,2錛?#8230;m-1錛夛紝鎵鏈夌殑鏁存暟蹇呯劧榪欎簺鏁存暟涓殑1涓妯鍚屼綑銆傚彇r[1]=0,r[2]=1,r[3]=2,r[4]=3錛?#8230;r=i-1,1<i<=m銆備護(hù)錛?錛夛細(xì)a[1]≡r[1](mod m),a[2]≡r[2](mod m),a≡r(mod m錛夛紙欏哄簭鍙互涓嶅悓錛夛紝鍥犱負(fù)鍙湁鍦ㄨ繖縐嶆儏鍐典笅鎵嶈兘淇濊瘉闆嗗悎{a1,a2,a3,a4錛?#8230;am}涓殑浠繪剰2涓暟涓嶅悓浣欙紝鍚﹀垯蹇呯劧鏈?涓暟鍚屼綑銆傜敱寮忥紙1錛夎嚜鐒跺緱鍒伴泦鍚坽a1,a2,a3,a4錛?#8230;am}瀵筸鏋勬垚瀹屽叏鍓╀綑緋匯?/span><div style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; font-family: arial, 瀹嬩綋, sans-serif; background-color: #ffffff; "></div><span style="font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">銆銆</span><strong style="font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">寮曠悊3錛庡墿浣欑郴瀹氱悊7</strong><div style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; font-family: arial, 瀹嬩綋, sans-serif; background-color: #ffffff; "></div><span style="font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">銆銆璁緈鏄竴涓暣鏁幫紝涓攎>1錛宐鏄竴涓暣鏁頒笖錛坢,b)=1銆傚鏋渁1,a2,a3,a4錛?#8230;am鏄ām鐨勪竴涓畬鍏ㄥ墿浣欑郴錛屽垯ba[1],ba[2],ba[3],ba[4]錛?#8230;ba[m]涔熸瀯鎴愭ām鐨勪竴涓畬鍏ㄥ墿浣欑郴銆?/span><div style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; font-family: arial, 瀹嬩綋, sans-serif; background-color: #ffffff; "></div><span style="font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">銆銆璇佹槑錛氳嫢瀛樺湪2涓暣鏁癰a鍜宐a[j]鍚屼綑鍗砨a≡ba[j](mod m錛夛紝鏍規(guī)嵁寮曠悊1鍒欐湁a≡a[j](mod m錛夈傛牴鎹畬鍏ㄥ墿浣欑郴鐨勫畾涔夊拰寮曠悊4錛堝畬鍏ㄥ墿浣欑郴涓換鎰?涓暟涔嬮棿涓嶅悓浣欙紝鏄撹瘉鏄庯級鍙煡榪欐槸涓嶅彲鑳界殑錛屽洜姝や笉瀛樺湪2涓暣鏁癰a鍜宐a[j]鍚屼綑銆傜敱寮曠悊5鍙煡ba[1],ba[2],ba[3],ba[4]錛?#8230;ba[m]鏋勬垚妯鐨勪竴涓畬鍏ㄥ墿浣欑郴銆?/span><div style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; font-family: arial, 瀹嬩綋, sans-serif; background-color: #ffffff; "></div><span style="font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">銆銆</span><strong style="font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">寮曠悊4錛?a target="_blank" style="color: #136ec2; ">鍚屼綑</a>瀹氱悊6</strong><div style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; font-family: arial, 瀹嬩綋, sans-serif; background-color: #ffffff; "></div><span style="font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">銆銆濡傛灉a,b,c,d鏄洓涓暣鏁幫紝涓攁≡b(mod m),c≡d(mod m錛夛紝鍒欐湁ac≡bd(mod m)</span><div style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; font-family: arial, 瀹嬩綋, sans-serif; background-color: #ffffff; "></div><span style="font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">銆銆璇佹槑錛氱敱棰樿寰梐c≡bc(mod m),bc≡bd(mod m錛夛紝鐢辨ā榪愮畻鐨勪紶閫掓у彲寰梐c≡bd(mod m)</span><div style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; font-family: arial, 瀹嬩綋, sans-serif; background-color: #ffffff; "></div><span style="font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">銆銆</span><strong style="font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">浜屻佽瘉鏄庤繃紼嬶細(xì)</strong><div style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; font-family: arial, 瀹嬩綋, sans-serif; background-color: #ffffff; "></div><span style="font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">銆銆鏋勯?/span><a target="_blank" style="color: #136ec2; font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">绱犳暟</a><span style="font-family: arial, 瀹嬩綋, sans-serif; line-height: 24px; background-color: #ffffff; ">p鐨勫畬鍏ㄥ墿浣欑郴P={1,2,3,4…錛坧-1)}錛屽洜涓猴紙a,p)=1錛岀敱寮曠悊3鍙緱A={a,2a,3a,4a錛?#8230;錛坧-1)a}涔熸槸p鐨勪竴涓畬鍏ㄥ墿浣欑郴銆備護(hù)W=1*2*3*4…*(p-1錛夛紝鏄劇劧W≡W(mod p錛夈備護(hù)Y=a*2a*3a*4a*…錛坧-1)a錛屽洜涓簕a,2a,3a,4a錛?#8230;錛坧-1)a}鏄痯鐨勫畬鍏ㄥ墿浣欑郴錛岀敱寮曠悊2浠ュ強(qiáng)寮曠悊4鍙緱a*2a*3a*…錛坧-1)a≡1*2*3*…錛坧-1)(mod p錛夊嵆W*a^(p-1錛?#8801;W(modp錛夈傛槗鐭ワ紙W,p)=1錛岀敱寮曠悊1鍙煡a^(p-1錛?#8801;1(modp錛?/span> <img src ="http://www.shnenglu.com/luyulaile/aggbug/170856.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/luyulaile/" target="_blank">luis</a> 2012-04-11 07:16 <a href="http://www.shnenglu.com/luyulaile/archive/2012/04/11/170856.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>嬈ф媺瀹氱悊璇佹槑 && 嬈ф媺鍏紡http://www.shnenglu.com/luyulaile/archive/2012/04/11/170855.htmlluisluisTue, 10 Apr 2012 23:11:00 GMThttp://www.shnenglu.com/luyulaile/archive/2012/04/11/170855.htmlhttp://www.shnenglu.com/luyulaile/comments/170855.htmlhttp://www.shnenglu.com/luyulaile/archive/2012/04/11/170855.html#Feedback0http://www.shnenglu.com/luyulaile/comments/commentRss/170855.htmlhttp://www.shnenglu.com/luyulaile/services/trackbacks/170855.html婧愬湴鍧錛?/span> http://www.shnenglu.com/zoyi-zhang/articles/43456.html 
嬈ф媺鍑芥暟 錛?/span>
嬈ф媺鍑芥暟鏄暟璁轟腑寰堥噸瑕佺殑涓涓嚱鏁幫紝嬈ф媺鍑芥暟鏄寚錛氬浜庝竴涓鏁存暟 n 錛屽皬浜?n 涓斿拰 n 浜掕川鐨勬鏁存暟錛堝寘鎷?1錛夌殑涓暟錛岃浣?φ(n) 銆?nbsp;

瀹屽叏浣欐暟闆嗗悎錛?/span>
瀹氫箟灝忎簬 n 涓斿拰 n 浜掕川鐨勬暟鏋勬垚鐨勯泦鍚堜負(fù) Zn 錛岀О鍛艱繖涓泦鍚堜負(fù) n 鐨勫畬鍏ㄤ綑鏁伴泦鍚堛?鏄劇劧 |Zn| 錛?#966;(n) 銆?/span>

鏈夊叧鎬ц川錛?/span>
瀵逛簬绱犳暟 p 錛?#966;(p) = p -1 銆?/span>
瀵逛簬涓や釜涓嶅悓绱犳暟 p錛?q 錛屽畠浠殑涔樼Н n = p * q 婊¤凍 φ(n) = (p -1) * (q -1)  銆?/span>
榪欐槸鍥犱負(fù) Zn = {1, 2, 3,  ... , n - 1} - {p, 2p, ... , (q - 1) * p} - {q, 2q, ... , (p - 1) * q} 錛?鍒?φ(n) = (n - 1) - (q - 1) - (p - 1) = (p -1) * (q -1)  錛?/span>φ(p) * φ(q) 銆?/span>

嬈ф媺瀹氱悊 錛?/span>
瀵逛簬浜掕川鐨勬鏁存暟 a 鍜?n 錛屾湁 aφ(n)  ≡ 1 mod n  銆?/span>

璇佹槑錛?br />( 1 ) 浠?nbsp;Zn = {x1, x2, ..., xφ(n)錛?nbsp;S = {a * x1 mod n, a * x2 mod n, ... , a * xφ(n) mod n} 錛?/span>
        鍒?Zn = S 銆?/span>
        ① 鍥犱負(fù) a 涓?n 浜掕川錛?/span> xi (1 ≤ i ≤ φ(n)) 涓?n 浜掕川錛?鎵浠?a * xi  涓?n 浜掕川錛屾墍浠?a * xi  mod n ∈ Zn 銆?/span>
        ② 鑻?i ≠ j 錛?閭d箞 xi ≠ xj錛屼笖鐢?a, n浜掕川鍙緱 a * xi mod n ≠ a * xj mod n 錛堟秷鍘誨緥錛夈?/span>

( 2 )     aφ(n) * x* x2 *... * xφ(n) mod n 
       (a * x1) * (a * x2) * ... * (a * xφ(n)) mod n
       (a * x1 mod n) * (a * xmod n) * ... * (a * xφ(n) mod n) mod n
        x* x* ... * xφ(n) mod n
      瀵規(guī)瘮絳夊紡鐨勫乏鍙充袱绔紝鍥犱負(fù) xi  (1 ≤ i ≤ φ(n)) 涓?n 浜掕川錛屾墍浠?nbsp;aφ(n)  ≡  1 mod n 錛堟秷鍘誨緥錛夈?br />娉細(xì)
娑堝幓寰嬶細(xì)濡傛灉 gcd(c,p) = 1 錛屽垯 ac ≡ bc mod p ⇒ a ≡ b mod p 銆?br />
璐歸┈瀹氱悊 錛?/span>
鑻ユ鏁存暟 a 涓庣礌鏁?p 浜掕川錛屽垯鏈?nbsp;ap - 1 ≡ 1 mod p 銆?br />璇佹槑榪欎釜瀹氱悊闈炲父綆鍗曪紝鐢變簬 φ(p) = p -1錛屼唬鍏ユ鎷夊畾鐞嗗嵆鍙瘉鏄庛?/span>
*****************************************************************************
琛ュ厖錛氭鎷夊嚱鏁板叕寮?br />

( 1 ) pk 鐨勬鎷夊嚱鏁?/h2>

瀵逛簬緇欏畾鐨勪竴涓礌鏁?p 錛?φ(p) = p -1銆傚垯瀵逛簬姝f暣鏁?n = pk 錛?/p>

 φ(n) = pk - pk -1

璇佹槑錛?/span>
灝忎簬 pk 鐨勬鏁存暟涓暟涓?pk - 1涓紝鍏朵腑
鍜?pk 涓嶄簰璐ㄧ殑姝f暣鏁版湁{p * 1,p * 2,...,p * (pk - 1-1)} 鍏辮 pk - 1 - 1 涓?/span>
鎵浠?φ(n) = pk - 1 - (pk - 1 - 1) = pk - pk - 1 銆?/span>

( 2 ) p * q 鐨勬鎷夊嚱鏁?/h2>

鍋囪 p, q鏄袱涓簰璐ㄧ殑姝f暣鏁幫紝鍒?p * q 鐨勬鎷夊嚱鏁頒負(fù)

φ(p * q) = φ(p) * φ(q) 錛?gcd(p, q) = 1 銆?/p>

璇佹槑錛?/span>
浠?n = p * q 錛?gcd(p,q) = 1
鏍規(guī)嵁涓浗浣欐暟瀹氱悊錛屾湁
Zn 鍜?Zp × Zq 涔嬮棿瀛樺湪涓涓鏄犲皠
錛堟垜鐨勬兂娉曟槸錛?a
∈ Zp 錛?b ∈ Zq ⇔ b * p + a * q ∈ Zn 銆?/span>錛?/span>
鎵浠?n 鐨勫畬鍏ㄤ綑鏁伴泦鍚堢殑鍏冪礌涓暟絳変簬闆嗗悎 Zp × Zq 鐨勫厓绱犱釜鏁般?/span>
鑰屽悗鑰呯殑鍏冪礌涓暟涓?φ(p) * φ(q) 錛屾墍浠ユ湁
φ(p * q) = φ(p) * φ(q) 銆?/span>

( 3 ) 浠繪剰姝f暣鏁扮殑嬈ф媺鍑芥暟

浠繪剰涓涓暣鏁?n 閮藉彲浠ヨ〃紺轟負(fù)鍏剁礌鍥犲瓙鐨勪箻縐負(fù)錛?/p>

      I
n = ∏ piki (I 涓?n 鐨勭礌鍥犲瓙鐨勪釜鏁?
i=1

鏍規(guī)嵁鍓嶉潰涓や釜緇撹錛屽緢瀹規(guī)槗寰楀嚭瀹冪殑嬈ф媺鍑芥暟涓猴細(xì)


I I
Φ(n) = ∏ piki -1(pi -1) = n
(1 - 1 / pi)
i=1
i=1

瀵逛簬浠繪剰 n > 2錛?span style="line-height: 24px; font-weight: bold; ">2 | Φ(n) ,鍥犱負(fù)蹇呭瓨鍦?nbsp; p-1 鏄伓鏁般?/p>



luis 2012-04-11 07:11 鍙戣〃璇勮
]]>
joj 2296 Boxs 緇勫悎鏁板http://www.shnenglu.com/luyulaile/archive/2009/07/21/90706.htmlluisluisTue, 21 Jul 2009 04:21:00 GMThttp://www.shnenglu.com/luyulaile/archive/2009/07/21/90706.htmlhttp://www.shnenglu.com/luyulaile/comments/90706.htmlhttp://www.shnenglu.com/luyulaile/archive/2009/07/21/90706.html#Feedback0http://www.shnenglu.com/luyulaile/comments/commentRss/90706.htmlhttp://www.shnenglu.com/luyulaile/services/trackbacks/90706.html棰樻剰鏄疦涓笉鍚岀殑鐩掑瓙錛孉涓畬鍏ㄧ浉鍚岀殑綰㈢悆錛孊涓畬鍏ㄧ浉鍚岀殑綃悆錛岀幇鍦ㄦ妸鐞冨線鐩掗噷瑁咃紝鐞冨彲浠ヤ笉鍏ㄩ儴瑁呭埌鐩掗噷錛岀洅鍙互涓虹┖錛岄棶鏂規(guī)硶鏁般?/p>

鍏跺疄灝辨槸鎶夾涓孩鐞冿紝B涓鐞冨垎鎴恘+1鍫嗭紙闄鍫嗗榪樻湁涓鍫嗗氨鏄病鏈夋斁鍏ョ洅涓殑錛夈?br>鎬濊礬寰堥噸瑕侊紝
鎴戠殑鎬濊礬鏄敱浜嶢鐞冿紝B鐞冧笉鍚岃壊錛屽彲浠ョ湅鎴愪袱涓嫭绔嬩簨浠訛紝鍒欑粨鏋滀負(fù)count(A)*count(B),
鍏朵腑count(A)琛ㄧずA鐨勬斁娉曪紝
鍒欏埄鐢ㄩ殧鏉挎硶(鎴栬呭閲嶉泦鐨剅緇勫悎)錛歝ount(A)=C(n+1+A-1,n+1-1   ),鍒╃敤pascal鍏紡c(n,m)=c(n-1,m)+c(n-1,m-1)鏉ユ眰璇ュ紡;

榪樻湁涓涓敞鎰忕偣褰撲笖浠呭綋n=20,a= 15 ,b=15鏃朵細(xì)瓚呭嚭long long 鑼冨洿銆傛墍浠ョ壒孌婂鐞?br>

鐐?+"灞曞紑
浠g爜鐐?浼?xì)鑷姩灞曞紑

luis 2009-07-21 12:21 鍙戣〃璇勮
]]>
joj 1206 Word Index 鍒╃敤緇勫悎鏁板鎬ц川 鎺ㄨ崘http://www.shnenglu.com/luyulaile/archive/2009/07/18/90406.htmlluisluisSat, 18 Jul 2009 02:08:00 GMThttp://www.shnenglu.com/luyulaile/archive/2009/07/18/90406.htmlhttp://www.shnenglu.com/luyulaile/comments/90406.htmlhttp://www.shnenglu.com/luyulaile/archive/2009/07/18/90406.html#Feedback0http://www.shnenglu.com/luyulaile/comments/commentRss/90406.htmlhttp://www.shnenglu.com/luyulaile/services/trackbacks/90406.html

Encoding schemes are often used in situations requiring encryption or information storage/transmission economy. Here, we develop a simple encoding scheme that encodes particular types of words with five or fewer (lower case) letters as integers.

Consider the English alphabet {a,b,c,...,z}. Using this alphabet, a set of valid words are to be formed that are in a strict lexicographic order. In this set of valid words, the successive letters of a word are in a strictly ascending order; that is, later letters in a valid word are always after previous letters with respect to their positions in the alphabet list {a,b,c,...,z}. For example,

abc aep gwz

are all valid three-letter words, whereas

aab are cat

are not.

For each valid word associate an integer which gives the position of the word in the alphabetized list of words. That is:

    a -> 1
b -> 2
.
.
z -> 26
ab -> 27
ac -> 28
.
.
az -> 51
bc -> 52
.
.
vwxyz -> 83681

Your program is to read a series of input lines. Each input line will have a single word on it, that will be from one to five letters long. For each word read, if the word is invalid give the number 0. If the word read is valid, give the word's position index in the above alphabetical list.

Input

The input consists of a series of single words, one per line. The words are at least one letter long and no more that five letters. Only the lower case alphabetic {a,b,...,z} characters will be used as input. The first letter of a word will appear as the first character on an input line.

The input will be terminated by end-of-file.

Output

The output is a single integer, greater than or equal to zero (0) and less than or equal 83681. The first digit of an output value should be the first character on a line. There is one line of output for each input line.

Sample Input

z
a
cat
vwxyz

Sample Output

26
1
0
83681

 

鍒╃敤緇勫悎鏁板瀹氱悊
{1,2,3,--,n}鐨剅緇勫悎a1,a2,--,ar鍑虹幇鍦▄1錛?錛?-錛宯}鐨剅緇勫悎鐨勫瓧鍏稿簭涓殑浣嶇疆鍙峰涓嬶細(xì)

C(n,r)-C(n-a1,r)-C(n-a2,r-1)-------C(n-ar-1錛?)-C(n-ar,1):璇佹槑鐣ワ紱

緇勫悎鏁癈(n,r)璁$畻鍒╃敤pascal鍏紡銆侰(n+1,k)=C(n,k-1)+C(n,k)

luis 2009-07-18 10:08 鍙戣〃璇勮
]]>
joj 1026 鍔ㄦ佽鍒掞紝鐢熸垚鍑芥暟鍙?qiáng)鏀箻q?/title><link>http://www.shnenglu.com/luyulaile/archive/2009/06/27/88628.html</link><dc:creator>luis</dc:creator><author>luis</author><pubDate>Sat, 27 Jun 2009 02:44:00 GMT</pubDate><guid>http://www.shnenglu.com/luyulaile/archive/2009/06/27/88628.html</guid><wfw:comment>http://www.shnenglu.com/luyulaile/comments/88628.html</wfw:comment><comments>http://www.shnenglu.com/luyulaile/archive/2009/06/27/88628.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/luyulaile/comments/commentRss/88628.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/luyulaile/services/trackbacks/88628.html</trackback:ping><description><![CDATA[<div id="bht1hbv" class=prob_text> <p>One curious child has a set of N little bricks. From these bricks he builds different staircases. Staircase consists of steps of different sizes in a strictly descending order. It is not allowed for staircase to have steps equal sizes. Every staircase consists of at least two steps and each step contains at least one brick. Picture gives examples of staircase for N=11 and N=5:</p> <p align=center><img height=163 src="http://acm.jlu.edu.cn/joj/images/problems/1026.gif" width=623> </p> <p align=left>Your task is to write a program that reads from input numbers N and writes to output numbers Q - amount of different staircases that can be built from exactly N bricks.</p> <br> <h3>Input</h3> Numbers N, one on each line. You can assume N is between 3 and 500, both inclusive. A number 0 indicates the end of input. <p> </p> <p> </p> <br> <h3>Output</h3> Numbers Q, one on each line. <p> </p> <br> <h3>Sample Input</h3> <pre>3 5 0 </pre> <h3>Sample Output</h3> <pre>1 2 </pre> 鏂規(guī)硶1錛屽姩鎬佽鍒?br><br>#include<iostream><br>#include<cstdlib><br>using namespace std;<br>  int main()<br>  {<br>  freopen("s.txt","r",stdin);<br>  freopen("key.txt","w",stdout);<br>  double f[501][501]={0};<br>  double s;<br>  int i,j,k,n;<br>  for(i=3;i<=500;i++)<br>  for(j=1;j<=(i-1)/2;j++)<br>    f[i][j]=1;<br>  for(i=3;i<=500;i++)<br>    for(j=1;j<=(i-1)/2;j++)<br>    {<br> for(k=j+1;k<=(i-j-1)/2;k++)<br>   f[i][j]=f[i-j][k]; <br> }<br>    while(scanf("%d",&n),n) { <br>        s=0; <br>        for(i=1;i<=(n-1)/2;i++) s+=f[n][i]; //f[n]=f[n][1]+f[n][2]+-----+f[n][floor((i-1)/2)]<br>        printf("%.0f\n",s); <br>    } <br>  //system("PAUSE");<br>  return   0;<br>  }<br>鏇村鐨勬柟娉曪細(xì)鐢熸垚鍑芥暟娉?br>璁$畻(1+x)(1+x^2)(1+x^3)-----,x^n鐨勭郴鏁板嵆涓烘墍姹?br>int i,j;<br>double ans[510]={1,1};//宸茬粡鎶奱ns[1]鍜宎ns[0]璧嬩負(fù)1浜嗭紝鍏朵綑涓?<br> for(i=2;i<=500;i++) {   <br>        for(j=500;j>=0;j--) {  <br>            if(i+j<=500) ans[i+j]+=ans[j]; <br>        }  <br>    }  <br><br>鍏堣綆?1+x)(1+x^2)<br>鍐嶈綆?1+x)(1+x^2)   *(1+x^3)<br></div> <img src ="http://www.shnenglu.com/luyulaile/aggbug/88628.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/luyulaile/" target="_blank">luis</a> 2009-06-27 10:44 <a href="http://www.shnenglu.com/luyulaile/archive/2009/06/27/88628.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title><杞笘> joj 1978 http://www.shnenglu.com/luyulaile/archive/2009/05/12/82667.htmlluisluisTue, 12 May 2009 03:42:00 GMThttp://www.shnenglu.com/luyulaile/archive/2009/05/12/82667.htmlhttp://www.shnenglu.com/luyulaile/comments/82667.htmlhttp://www.shnenglu.com/luyulaile/archive/2009/05/12/82667.html#Feedback0http://www.shnenglu.com/luyulaile/comments/commentRss/82667.htmlhttp://www.shnenglu.com/luyulaile/services/trackbacks/82667.html#include <cstdio>
#include 
<string>

int b[51][51][50], N;

void add ( int i, int j )
{
    
int k;
    
for ( k = 0; k < 50; k ++ )
        b[i][j][k] 
= b[i - 1][j - 1][k] + b[i - 1][j][k] * j;
    
int c = 0, t;
    
for ( k = 0; k < 50; k ++ )
    
{
        t 
= b[i][j][k] + c;
        c 
= t / 10;
        b[i][j][k] 
= t % 10;
    }

}


void dp ()
{
    memset ( b, 
0x00sizeof ( b ) );
    
int i, j;
    
for ( i = 1; i <= 50; i ++ )
    
{
        b[i][
1][0= b[i][i][0= 1;
    }

    
for ( i = 3; i <= 50; i ++ )
    
{
        
for ( j = 2; j < i; j ++ )
        
{
            add ( i, j );
        }

    }

}


void print ( int i, int j )
{
    
int k;
    
for ( k = 49; k >= 0; k -- )
        
if ( b[i][j][k] )
            
break;
    
if ( k == -1 )
        printf ( 
"0" );
    
for ( ; k >= 0; k -- )
        printf ( 
"%d", b[i][j][k] );
    printf ( 
" " );
}


void print ( int n )
{
    printf ( 
"%d ", n );
    
int i, j, k;
    
int ans[50];
    memset ( ans, 
0sizeof ( ans ) );
    
for ( i = 1; i <= n; i ++ )
    
{
        
for ( j = 0; j < 50; j ++ )
        
{
            ans[j] 
+= b[n][i][j];
        }

    }

    
int t, c = 0;
    
for ( k = 0; k < 50; k ++ )
    
{
        t 
= ans[k] + c;
        c 
= t / 10;
        ans[k] 
= t % 10;
    }

    
for ( k = 49; k >= 0; k -- )
        
if ( ans[k] )
            
break;
    
if ( k == -1 )
        printf ( 
"0" );
    
for ( ; k >= 0; k -- )
        printf ( 
"%d", ans[k] );
    printf ( 
" " );
}


int main ()
{
    
//freopen ( "in.txt", "r", stdin );
    dp ();
    
//print ( 5, 2 );
    while ( scanf ( "%d"&N ) && N )
    
{
        print ( N );
    }

    
return 0;
}

Rhyme Schemes
Status In/Out TIME Limit MEMORY Limit Submit Times Solved Users JUDGE TYPE
stdin/stdout 3s 8192K 97 55 Special Test

The rhyme scheme for a poem (or stanza of a longer poem) tells which lines of the poem rhyme with which other lines. For example, a limerick such as


If computers that you build are quantum
Then spies of all factions will want 'em
Our codes will all fail
And they'll read our email
`Til we've crypto that's quantum and daunt 'em
Jennifer and Peter Short(http://www.research.att.com/~shor/notapoet.html)
Has a rhyme scheme of aabba, indicating that the first, second and fifth lines rhyme and the third and fourth lines rhyme.

For a poem or stanza of four lines, there are 15 possible rhyme schemes: aaaa, aaab, aaba, aabb, aabc, abaa, abab, abac, abba, abbb, abbc, abca, abcb, abcc, and abcd.

Write a program to compute the number of rhyme schemes for a poem or stanza of N lines where N is an input value.

Input

Input will consist of a sequence of integers N, one per line, ending with a 0 (zero) to indicate the end of the data. N is the number of lines in a poem.

Output

For each input integer N, your program should output the value of N, followed by a space, followed by the number of rhyme schemes for a poem with N lines as a decimal integer with at least 12 correct significant digits (use double precision floating point for your computations).

Sample Input

1
2
3
4
20
30
10
0

Sample Output

1 1
2 2
3 5
4 15
20 51724158235372
30 846749014511809120000000
10 115975


 
鎺掑垪緇勫悎鐨勯鐩紝澶ц嚧涓婁粠灝忓埌澶ч『鎺ㄥ嵆鍙傝b[i][j]涓璱琛ㄧず瀛楃涓查暱搴︼紝j琛ㄧず瀛楃涓蹭腑鐢ㄥ埌鐨勫瓧姣嶄釜鏁幫紝涓嶉毦鎺ㄥ嚭b[i][j] = b[i-1][j-1] + b[i - 1][j] * j銆?br>鑰屾垜鑷繁鐨勬濊礬涓鐩存槸鎯蟲牴鎹渶鍚庣殑閭d竴涓瓧姣嶆潵鎺紝鎺ㄤ笉鍑烘潵



luis 2009-05-12 11:42 鍙戣〃璇勮
]]>
亚洲国产精品久久电影欧美| 国内精品久久久久影院优| 色婷婷久久综合中文久久一本| 亚洲国产天堂久久综合| 久久久久久国产精品免费无码 | 97久久精品人妻人人搡人人玩| 久久精品国产91久久综合麻豆自制| 国产AV影片久久久久久| 亚洲国产精品18久久久久久| 99久久伊人精品综合观看| 影音先锋女人AV鲁色资源网久久| 国产精品久久久久久搜索| 久久精品国产99国产精品导航| 久久91精品久久91综合| 久久99精品久久久大学生| 国产免费久久精品丫丫| 精品综合久久久久久888蜜芽| 久久久久国产视频电影| 99久久精品国产免看国产一区| 中文字幕无码久久精品青草| 国产福利电影一区二区三区久久久久成人精品综合 | 999久久久免费精品国产| 久久天堂电影网| 久久精品国产亚洲AV电影 | 欧美精品一区二区精品久久| 久久久久亚洲av综合波多野结衣| 久久人人爽人人爽人人片AV东京热| 久久精品国产亚洲网站| 丰满少妇高潮惨叫久久久| 日韩人妻无码精品久久免费一| 久久久一本精品99久久精品88| 思思久久99热免费精品6| 久久久国产精品| 久久久久国产一区二区| 国产精品无码久久久久| 91超碰碰碰碰久久久久久综合| 青青草国产精品久久久久| 久久免费精品一区二区| 久久综合丝袜日本网| 免费国产99久久久香蕉| 国产成人无码精品久久久免费|