锘??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美在线首页,国产精品嫩草99a,激情成人综合网http://m.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://m.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://m.shnenglu.com/luyulaile/archive/2012/04/11/170856.html</guid><wfw:comment>http://m.shnenglu.com/luyulaile/comments/170856.html</wfw:comment><comments>http://m.shnenglu.com/luyulaile/archive/2012/04/11/170856.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/luyulaile/comments/commentRss/170856.html</wfw:commentRss><trackback:ping>http://m.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; ">鐚滄兂錛岃繖涓寽鎯蟲槸涓浗鏁板瀹舵彁鍑烘潵鐨勶紝鍏跺唴瀹逛負錛氬綋涓斾粎褰?^(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騫寸殑鏃跺欏氨宸茬粡璁よ瘑涓浗鐚滄祴浜嗭紝浣嗕篃鏈変漢璁や負瀹為檯涓婁腑鍥界寽嫻嬫槸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; ">涓銆佸噯澶囩煡璇嗭細</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銆備護錛?錛夛細a[1]≡r[1](mod m),a[2]≡r[2](mod m),a≡r(mod m錛夛紙欏哄簭鍙互涓嶅悓錛夛紝鍥犱負鍙湁鍦ㄨ繖縐嶆儏鍐典笅鎵嶈兘淇濊瘉闆嗗悎{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錛夛紝鏍規嵁寮曠悊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; ">浜屻佽瘉鏄庤繃紼嬶細</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鐨勪竴涓畬鍏ㄥ墿浣欑郴銆備護W=1*2*3*4…*(p-1錛夛紝鏄劇劧W≡W(mod p錛夈備護Y=a*2a*3a*4a*…錛坧-1)a錛屽洜涓簕a,2a,3a,4a錛?#8230;錛坧-1)a}鏄痯鐨勫畬鍏ㄥ墿浣欑郴錛岀敱寮曠悊2浠ュ強寮曠悊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://m.shnenglu.com/luyulaile/aggbug/170856.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/luyulaile/" target="_blank">luis</a> 2012-04-11 07:16 <a href="http://m.shnenglu.com/luyulaile/archive/2012/04/11/170856.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>嬈ф媺瀹氱悊璇佹槑 && 嬈ф媺鍏紡http://m.shnenglu.com/luyulaile/archive/2012/04/11/170855.htmlluisluisTue, 10 Apr 2012 23:11:00 GMThttp://m.shnenglu.com/luyulaile/archive/2012/04/11/170855.htmlhttp://m.shnenglu.com/luyulaile/comments/170855.htmlhttp://m.shnenglu.com/luyulaile/archive/2012/04/11/170855.html#Feedback0http://m.shnenglu.com/luyulaile/comments/commentRss/170855.htmlhttp://m.shnenglu.com/luyulaile/services/trackbacks/170855.html婧愬湴鍧錛?/span> http://m.shnenglu.com/zoyi-zhang/articles/43456.html 
嬈ф媺鍑芥暟 錛?/span>
嬈ф媺鍑芥暟鏄暟璁轟腑寰堥噸瑕佺殑涓涓嚱鏁幫紝嬈ф媺鍑芥暟鏄寚錛氬浜庝竴涓鏁存暟 n 錛屽皬浜?n 涓斿拰 n 浜掕川鐨勬鏁存暟錛堝寘鎷?1錛夌殑涓暟錛岃浣?φ(n) 銆?nbsp;

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

鏈夊叧鎬ц川錛?/span>
瀵逛簬绱犳暟 p 錛?#966;(p) = p -1 銆?/span>
瀵逛簬涓や釜涓嶅悓绱犳暟 p錛?q 錛屽畠浠殑涔樼Н n = p * q 婊¤凍 φ(n) = (p -1) * (q -1)  銆?/span>
榪欐槸鍥犱負 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>
        ① 鍥犱負 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
      瀵規瘮絳夊紡鐨勫乏鍙充袱绔紝鍥犱負 xi  (1 ≤ i ≤ φ(n)) 涓?n 浜掕川錛屾墍浠?nbsp;aφ(n)  ≡  1 mod n 錛堟秷鍘誨緥錛夈?br />娉細
娑堝幓寰嬶細濡傛灉 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 鐨勬鎷夊嚱鏁頒負

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

璇佹槑錛?/span>
浠?n = p * q 錛?gcd(p,q) = 1
鏍規嵁涓浗浣欐暟瀹氱悊錛屾湁
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 閮藉彲浠ヨ〃紺轟負鍏剁礌鍥犲瓙鐨勪箻縐負錛?/p>

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

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


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) ,鍥犱負蹇呭瓨鍦?nbsp; p-1 鏄伓鏁般?/p>



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

鍏跺疄灝辨槸鎶夾涓孩鐞冿紝B涓鐞冨垎鎴恘+1鍫嗭紙闄鍫嗗榪樻湁涓鍫嗗氨鏄病鏈夋斁鍏ョ洅涓殑錛夈?br>鎬濊礬寰堥噸瑕侊紝
鎴戠殑鎬濊礬鏄敱浜嶢鐞冿紝B鐞冧笉鍚岃壊錛屽彲浠ョ湅鎴愪袱涓嫭绔嬩簨浠訛紝鍒欑粨鏋滀負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鏃朵細瓚呭嚭long long 鑼冨洿銆傛墍浠ョ壒孌婂鐞?br>

鐐?+"灞曞紑
浠g爜鐐?浼氳嚜鍔ㄥ睍寮

luis 2009-07-21 12:21 鍙戣〃璇勮
]]>
joj 1206 Word Index 鍒╃敤緇勫悎鏁板鎬ц川 鎺ㄨ崘http://m.shnenglu.com/luyulaile/archive/2009/07/18/90406.htmlluisluisSat, 18 Jul 2009 02:08:00 GMThttp://m.shnenglu.com/luyulaile/archive/2009/07/18/90406.htmlhttp://m.shnenglu.com/luyulaile/comments/90406.htmlhttp://m.shnenglu.com/luyulaile/archive/2009/07/18/90406.html#Feedback0http://m.shnenglu.com/luyulaile/comments/commentRss/90406.htmlhttp://m.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錛?錛?-錛宯}鐨剅緇勫悎鐨勫瓧鍏稿簭涓殑浣嶇疆鍙峰涓嬶細

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 鍔ㄦ佽鍒掞紝鐢熸垚鍑芥暟鍙婃敼榪?/title><link>http://m.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://m.shnenglu.com/luyulaile/archive/2009/06/27/88628.html</guid><wfw:comment>http://m.shnenglu.com/luyulaile/comments/88628.html</wfw:comment><comments>http://m.shnenglu.com/luyulaile/archive/2009/06/27/88628.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/luyulaile/comments/commentRss/88628.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/luyulaile/services/trackbacks/88628.html</trackback:ping><description><![CDATA[<div id="hvzpftn" 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> 鏂規硶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>鏇村鐨勬柟娉曪細鐢熸垚鍑芥暟娉?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]璧嬩負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://m.shnenglu.com/luyulaile/aggbug/88628.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/luyulaile/" target="_blank">luis</a> 2009-06-27 10:44 <a href="http://m.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://m.shnenglu.com/luyulaile/archive/2009/05/12/82667.htmlluisluisTue, 12 May 2009 03:42:00 GMThttp://m.shnenglu.com/luyulaile/archive/2009/05/12/82667.htmlhttp://m.shnenglu.com/luyulaile/comments/82667.htmlhttp://m.shnenglu.com/luyulaile/archive/2009/05/12/82667.html#Feedback0http://m.shnenglu.com/luyulaile/comments/commentRss/82667.htmlhttp://m.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 鍙戣〃璇勮
]]>
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            欧美日韩高清区| 国产九九精品| 永久555www成人免费| 久久久噜噜噜久久人人看| 欧美在线精品一区| 亚洲电影中文字幕| 一区二区三区av| 激情婷婷欧美| 一本一本久久a久久精品综合麻豆 一本一本久久a久久精品牛牛影视 | 一本久道久久综合中文字幕| 中文欧美在线视频| 在线精品视频在线观看高清| 一本大道久久a久久精品综合 | 亚洲精品一区二区三区av| 国产精品亚洲视频| 亚洲第一精品夜夜躁人人爽| 欧美国产日韩免费| 羞羞漫画18久久大片| 欧美电影免费观看高清| 久久久精品视频成人| 欧美日韩综合在线免费观看| 欧美成人精品h版在线观看| 欧美视频不卡中文| 亚洲黄色毛片| 一区二区三区在线视频播放| 亚洲欧美一区二区精品久久久| 亚洲毛片在线看| 久久精品一级爱片| 欧美在线免费观看视频| 欧美日韩综合视频网址| 亚洲国产美国国产综合一区二区 | 亚洲视频电影在线| 亚洲精品亚洲人成人网| 久久久亚洲人| 久久婷婷国产综合精品青草| 国产精品手机在线| 日韩一级二级三级| 一本色道综合亚洲| 欧美成人综合| 欧美激情亚洲视频| 亚洲国产婷婷香蕉久久久久久99 | 午夜视频在线观看一区| 欧美日韩视频专区在线播放| 亚洲高清影视| 亚洲国产日韩精品| 久久亚洲欧美国产精品乐播| 久久一区二区三区四区五区| 国产一区二区电影在线观看| 午夜久久福利| 亚洲午夜激情网站| 亚洲性线免费观看视频成熟| 欧美精品久久一区二区| 亚洲国产一区二区三区高清| 亚洲精品日韩在线观看| 欧美二区乱c少妇| 亚洲人成在线观看| 亚洲精品在线三区| 欧美好吊妞视频| 99国产精品一区| 午夜精品电影| 国产一区日韩欧美| 久久中文字幕一区| 亚洲激情网址| 一区二区三区.www| 国产精品大片免费观看| 亚洲欧美在线观看| 美日韩在线观看| 亚洲国产精品一区制服丝袜| 欧美激情一二区| 在线天堂一区av电影| 久久精品免费| 亚洲韩国日本中文字幕| 欧美精品成人91久久久久久久| 亚洲精品激情| 午夜在线观看免费一区| 激情av一区| 欧美激情亚洲国产| 亚洲视频一区在线| 久久亚洲精品网站| 亚洲欧洲免费视频| 国产精品久久久久91| 久久精品国产久精国产爱| 欧美激情影院| 午夜视频精品| 亚洲精品日产精品乱码不卡| 欧美日韩色婷婷| 久久高清国产| 亚洲精品久久嫩草网站秘色| 欧美亚洲一区二区三区| 亚洲国产精品久久久久| 欧美午夜视频网站| 久久精品国产999大香线蕉| 亚洲激情一区| 久久久精品国产一区二区三区| 99国产欧美久久久精品| 国产精品一区二区黑丝| 欧美二区在线播放| 欧美综合二区| 99视频一区二区| 欧美电影美腿模特1979在线看| 亚洲一区成人| 亚洲国产黄色| 国产日韩欧美精品综合| 欧美精品一区在线观看| 欧美一区二区视频在线观看2020| 亚洲国产aⅴ天堂久久| 欧美在线精品免播放器视频| 夜夜爽www精品| 亚洲福利视频专区| 国产夜色精品一区二区av| 欧美视频免费| 欧美国产在线视频| 久久在精品线影院精品国产| 亚洲女爱视频在线| 日韩亚洲欧美一区| 亚洲国产精品久久久久婷婷884| 久久久久国产精品厨房| 亚洲欧美日韩精品久久久| 日韩一区二区电影网| 亚洲国产成人在线视频| 韩日成人在线| 国产一区清纯| 欧美日韩一区高清| 亚洲激情视频| 欧美激情网站在线观看| 欧美成人午夜剧场免费观看| 久久久精品五月天| 久久久天天操| 久久久久久久999| 久久高清一区| 欧美一区二区三区在线播放| 亚洲综合色婷婷| 亚洲制服欧美中文字幕中文字幕| 一二三区精品| 亚洲视频一二区| 亚洲一区二区av电影| 亚洲天堂成人在线观看| 中文国产成人精品| 一区二区毛片| 亚洲一区美女视频在线观看免费| 中日韩午夜理伦电影免费| 日韩一区二区高清| 99精品免费视频| 一区二区三区日韩精品视频| 亚洲精品女人| 亚洲最黄网站| 亚洲一区国产| 香蕉尹人综合在线观看| 欧美有码在线视频| 久久久久久电影| 欧美成人免费播放| 亚洲国产欧美日韩| 亚洲精选久久| 制服诱惑一区二区| 亚洲视频播放| 久久精品中文| 欧美国产大片| 欧美性做爰毛片| 国产亚洲人成网站在线观看| 欧美精品一二三| 欧美三日本三级少妇三99| 国产精品久久| 精品成人在线观看| 亚洲狼人综合| 亚洲欧美中日韩| 久久久亚洲成人| 亚洲激情视频在线| 亚洲欧美不卡| 老司机aⅴ在线精品导航| 欧美人成网站| 国产欧美日韩中文字幕在线| 伊人婷婷欧美激情| av不卡免费看| 久久久久久电影| 日韩视频在线一区二区| 亚洲一区二区三区免费在线观看| 欧美一级精品大片| 免费在线成人av| 国产精品一区二区男女羞羞无遮挡| 国产午夜一区二区三区| 亚洲毛片播放| 亚洲综合首页| 久久精品中文字幕一区| 亚洲第一在线综合网站| 亚洲一区精品在线| 蜜桃av噜噜一区二区三区| 国产精品日本一区二区| 黑人中文字幕一区二区三区| 一本色道久久99精品综合| 久久久久青草大香线综合精品| 亚洲精品视频啊美女在线直播| 久久高清一区| 国产精品美女视频网站| 亚洲精品美女在线观看| 欧美一区二区三区喷汁尤物| 亚洲三级色网| 六月婷婷久久| 国产亚洲a∨片在线观看| 亚洲美女色禁图| 久久夜色精品一区|