锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产综合亚洲精品一区二,一区二区三区久久久,亚洲一本视频http://www.shnenglu.com/linyangfei/category/5206.html鎴愰暱鐨勮礬鈥︹︽簮zh-cnThu, 25 Sep 2008 12:09:27 GMTThu, 25 Sep 2008 12:09:27 GMT60鏍?wèi)鐘舵暟缁勫涔?fàn)蹇冨緱http://www.shnenglu.com/linyangfei/archive/2008/09/24/62688.html椋為椋為Wed, 24 Sep 2008 08:35:00 GMThttp://www.shnenglu.com/linyangfei/archive/2008/09/24/62688.htmlhttp://www.shnenglu.com/linyangfei/comments/62688.htmlhttp://www.shnenglu.com/linyangfei/archive/2008/09/24/62688.html#Feedback0http://www.shnenglu.com/linyangfei/comments/commentRss/62688.htmlhttp://www.shnenglu.com/linyangfei/services/trackbacks/62688.html闃呰鍏ㄦ枃

椋為 2008-09-24 16:35 鍙戣〃璇勮
]]>
鏁板涓殑鐖嗘悶棰?/title><link>http://www.shnenglu.com/linyangfei/archive/2008/09/19/62306.html</link><dc:creator>椋為</dc:creator><author>椋為</author><pubDate>Fri, 19 Sep 2008 13:23:00 GMT</pubDate><guid>http://www.shnenglu.com/linyangfei/archive/2008/09/19/62306.html</guid><wfw:comment>http://www.shnenglu.com/linyangfei/comments/62306.html</wfw:comment><comments>http://www.shnenglu.com/linyangfei/archive/2008/09/19/62306.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/linyangfei/comments/commentRss/62306.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/linyangfei/services/trackbacks/62306.html</trackback:ping><description><![CDATA[   浠婂ぉ涓婄綉闅忎究閫涢涳紝鏃犳剰闂寸湅鍒拌繖浜涢鐩涓虹啛鎮(zhèn)夛紝瑕佹槸褰撳勾涓鏁板鑰冭瘯鐨勬椂鍊欒兘澶熸嬁鐢?shù)鑴懢~栫▼灝卞ソ浜嗐?br><br>1錛夋睙嫻峰競鐢?shù)璇濆忥L(fēng)爜鏄?浣嶆暟錛屾瘡涓浣嶄笂鐨勬暟鐮佸彲浠ユ槸0錛?錛?···8錛?涓換鎰忎竴涓紙鏁板瓧鍙互閲嶅鍑虹幇錛屽00000涔熺畻涓涓數(shù)璇濆彿鐮侊級錛岄偅涔堣繖涓煄甯傛渶澶氭湁澶氬皯涓數(shù)璇濆彿鐮侊紵 <br>錛?錛夌敤0錛?錛?錛?榪?涓暟瀛楋紝鍙互緇勬垚澶氬皯涓病鏈夐噸澶嶇殑4浣嶆暟錛?<br>錛?錛?#8220;IMO”鏄浗闄呭ゥ鏋楀尮鍏嬬殑緙╁啓錛屾妸3涓瓧姣嶅啓鎴?縐嶄笉鍚岀殑棰滆壊錛岀幇鍦ㄦ湁5縐嶄笉鍚岀殑棰滆壊絎旓紝鎸変笂榪拌姹傝兘鍐欏嚭澶氬皯縐嶄笉鍚岄鑹叉惌閰嶇殑“IMO”.<br><br>絳旀鏄?span style="COLOR: #ffffff">錛?1) 100000縐?nbsp;<br>              錛?錛?8縐?nbsp;<br>              錛?錛?0縐?br></span><br><br></cd>涓嶈繃濂藉儚浜鴻剳瑕佹瘮鐖嗘悶鏇村揩浜?#8230;…ft<img src ="http://www.shnenglu.com/linyangfei/aggbug/62306.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/linyangfei/" target="_blank">椋為</a> 2008-09-19 21:23 <a href="http://www.shnenglu.com/linyangfei/archive/2008/09/19/62306.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鏈灝忕偣瑕嗙洊 POJ 2060 Taxi Cab Schemehttp://www.shnenglu.com/linyangfei/archive/2008/09/15/61878.html椋為椋為Mon, 15 Sep 2008 11:46:00 GMThttp://www.shnenglu.com/linyangfei/archive/2008/09/15/61878.htmlhttp://www.shnenglu.com/linyangfei/comments/61878.htmlhttp://www.shnenglu.com/linyangfei/archive/2008/09/15/61878.html#Feedback0http://www.shnenglu.com/linyangfei/comments/commentRss/61878.htmlhttp://www.shnenglu.com/linyangfei/services/trackbacks/61878.htmlTaxi Cab Scheme

Time Limit: 1000MS

 

Memory Limit: 30000K

Total Submissions: 1342

 

Accepted: 587

Description

Running a taxi station is not all that simple. Apart from the obvious demand for a centralised coordination of the cabs in order to pick up the customers calling to get a cab as soon as possible,there is also a need to schedule all the taxi rides which have been booked in advance.Given a list of all booked taxi rides for the next day, you want to minimise the number of cabs needed to carry out all of the rides.
For the sake of simplicity, we model a city as a rectangular grid. An address in the city is denoted by two integers: the street and avenue number. The time needed to get from the address a, b to c, d by taxi is |a - c| + |b - d| minutes. A cab may carry out a booked ride if it is its first ride of the day, or if it can get to the source address of the new ride from its latest,at least one minute before the new ride's scheduled departure. Note that some rides may end after midnight.

Input

On the first line of the input is a single positive integer N, telling the number of test scenarios to follow. Each scenario begins with a line containing an integer M, 0 < M < 500, being the number of booked taxi rides. The following M lines contain the rides. Each ride is described by a departure time on the format hh:mm (ranging from 00:00 to 23:59), two integers a b that are the coordinates of the source address and two integers c d that are the coordinates of the destination address. All coordinates are at least 0 and strictly smaller than 200. The booked rides in each scenario are sorted in order of increasing departure time.

Output

For each scenario, output one line containing the minimum number of cabs required to carry out all the booked taxi rides.

Sample Input

2
2
08:00 10 11 9 16
08:07 9 16 10 11
2
08:00 10 11 9 16
08:06 9 16 10 11

Sample Output

1
2

Source

Northwestern Europe 2004

 

 

       鏍規(guī)嵁榪欓亾棰樼洰鐨勬剰鎬濓紝鎴戜滑鍙互寤轟竴寮犲浘錛屽浜庝袱涓?/span>booked taxi ride錛?/span>ri鍜?/span>rj濡傛灉涓杈嗚濺鑳藉鍏堝畬鎴?/span>ri鐨勪換鍔″啀鏈夋椂闂磋刀鍘誨畬鎴?/span>rj鐨勪換鍔★紝閭d箞灝卞緩绔嬩竴鏉?/span>ri鎸囧悜rj鐨勮竟銆?br>

       鎸夌収棰樼洰鐨勮姹傦紝瑕侀夋嫨鏈灝戠殑taxi鏉ュ畬鎴愯繖浜涗換鍔°傛樉鐒跺湪涓婇潰榪欎釜渚嬪瓙涓紝闇瑕佸畨鎺?/span>2杈?/span>taxi銆傜粨鍚堣繖涓浘錛屽彲浠ユ妸棰樼洰鐨勮姹傝漿鍖栦負(fù)鎵懼嚭鏈灝戠殑璺緞鏉℃暟錛屼嬌寰楄繖浜涜礬寰勮鐩栭斾腑鎵鏈夌殑杈癸紝渚嬪鍙互閫夋嫨2鏉¤礬寰?/span>1->3->4鍜?/span>1->2灝卞彲浠ヨ鐩栨墍鏈夌殑杈廣備篃鍙互閫夋嫨1->3->4鍜?/span>2錛堝洜涓?/span>2浣滀負(fù)鍒濆绔欙紝涓嶉渶瑕佺敱1杞Щ榪囨潵錛夈傚浜庝竴鏉¤繛緇殑璺緞vi1->vi2->…vik鐢變簬榪欐潯璺緞涓婄殑浠誨姟瀹為檯涓婃槸鐢變竴杈?/span>taxi鏉ュ畬鎴愮殑錛屽彲浠ュ惂榪欐潯璺緞閫鍖栨垚涓や釜鐐?/span>vi1->vik銆傛湁浜嗚繖涓ゆ寤哄浘鐨勬楠や互鍚庯紝闂鐨勬眰瑙e氨鍙互鍙樹負(fù)鎵懼嚭欏剁偣闆嗙殑涓涓渶灝忓瓙闆嗭紝浣胯繖涓《鐐瑰瓙闆嗚鐩栨墍鏈夌殑杈癸紙姣忔潯杈歸兘鑷沖皯鍜屼竴涓《鐐歸泦鐨勯《鐐圭浉榪烇級銆傝繖涓棶棰樺氨鏄浘鐨勬渶灝忕偣瑕嗙洊銆傚啀鐪嬭繖寮犲浘錛岃繕鏈変竴浜涙ц川鑳藉璁╂垜浠洿濂藉湴姹傚嚭鏈灝忕偣瑕嗙洊銆傝繖涓浘鏄竴涓湁鍚戞棤鐜浘錛屾病鏈夎嚜鐜紝灝卞彲浠ユ媶鐐癸紝鎶婂師鍏堝緩鐨勫浘鍙樻垚涓寮犱簩鍒嗗浘銆?br>

鍙互鍐嶅浘涓湅鍑猴紝涓婇潰涓懼嚭鐨勪竴鏉¤礬寰?/span>1->3->4瀵瑰簲浜嗚繖涓簩鍒嗗浘涓殑璺緞1->3’->3->4’錛屽湪榪欎釜浜屽垎鍥句腑灝遍渶瑕佹眰涓涓渶澶х嫭绔嬪瓙闆嗭紙榪欓噷鐨?/span>4鐐瑰氨鏄竴鏉¤礬寰勭殑緇堢偣錛屾病涓鏉¤礬寰勫嵆瀵瑰簲鏈変竴涓粓鐐癸紒錛夈備簩鍒嗗浘鐨勬渶澶х嫭绔嬫暟鏄葷偣鏁頒笌鏈澶у尮閰嶆暟鐨勫樊鍊箋傛帴涓嬫潵寤哄浘錛屾媶鐐癸紝姹備簩鍒嗗浘鏈澶у尮閰嶅氨鑳借В鍐寵繖閬撻鐩簡銆?br>




椋為 2008-09-15 19:46 鍙戣〃璇勮
]]>
浠庡笇鏈涜蛋鍚戝け鏈?/title><link>http://www.shnenglu.com/linyangfei/archive/2008/08/29/60388.html</link><dc:creator>椋為</dc:creator><author>椋為</author><pubDate>Fri, 29 Aug 2008 10:43:00 GMT</pubDate><guid>http://www.shnenglu.com/linyangfei/archive/2008/08/29/60388.html</guid><wfw:comment>http://www.shnenglu.com/linyangfei/comments/60388.html</wfw:comment><comments>http://www.shnenglu.com/linyangfei/archive/2008/08/29/60388.html#Feedback</comments><slash:comments>7</slash:comments><wfw:commentRss>http://www.shnenglu.com/linyangfei/comments/commentRss/60388.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/linyangfei/services/trackbacks/60388.html</trackback:ping><description><![CDATA[<p>   浠婃棭涓婂畬“璁$畻鏈哄浘褰㈠浘鍍?#8221;璇懼悗錛屾垜榪欎釜瀛︽湡鍞竴鐨勫笇鏈涢兘鐮寸伃浜嗭紙榪欏鏈熷緱鐫¤繃鍘諱簡錛夈傛垜涓鐩撮兘瑙?/p> <p>寰?#8220;璁$畻鏈哄浘褰㈠”鍜?#8220;璁$畻鏈哄浘鍍忓鐞?#8221;鏄袱闂ㄥ緢鏈夋剰鎬濈殑璇劇▼銆傝繖瀛︽湡鎴戜滑鐨勮紼嬪畨鎺掕繕鏄竴璐綔椋?/p> <p>鈥斺旇紼嬪帇緙╋紝鎶婅繖涓ら棬璇劇▼鍘嬫垚浜嗕竴闂ㄨ紼嬶紝涓嶄粎濡傛榪樹嬌鐢ㄧ殑鏄唴閮ㄦ暀鏉愶紙浼犺涓殑鍐呴儴鏁欐潗灝辨槸鎶?/p> <p>璇劇▼鍐呭榪涗竴姝ョ簿綆鍘嬬緝錛夈傚嵆渚垮湪榪欑鎯呭喌涔嬩笅錛屾垜榪樻槸瀵硅綆楁満鍥懼艦鍥懼儚澶勭悊鍏呮弧鐑儏錛屾兂澶氬浜涗笢</p> <p>瑗匡紝濂藉ソ鍦板仛璇劇▼璁捐銆備粖澶╀復(fù)涓嬭鍓嶏紝鑰佸笀鎶婅紼嬭璁$殑棰樼洰甯冪疆涓嬫潵錛岀湡浠ゆ垜褰誨簳澶辨湜浜嗐傚竷緗簡20+</p> <p>涓鐩紝铏借娑夊強(qiáng)涓浜涘啗浜嬶紝浣嗘槸瑕佹眰鐪熺殑寰堟按銆傚悗闈㈢粰鍑轟簡涓緋誨垪鍐涗簨鐢?shù)濯勫Q岀伨闅劇數(shù)褰卞ぇ鐗囷紝鍋氭硶灝辨槸</p> <p>錛?br>1銆佺湅鐗囷紱<br>2銆佹埅鍥句笌PS錛?br>3銆佸啓鎶ュ憡涓庡仛ppt銆?br>   鎴戞兂浜嗕竴涓嬶紝榪欓噷闈㈠彲鑳戒竴鐐圭悊璁猴紝涓鐐圭紪紼嬮兘涓嶄細(xì)娑夊強(qiáng)鍒幫紝榪欐牱鐨勮紼嬭璁★紝鐜╄繃鐢?shù)鑴戠殑錆h閮戒細(xì)鍋氾紝榪?/p> <p>騫插槢娣誨湪“淇℃伅宸ョ▼”涓撲笟鐨?#8220;璇劇▼璁捐”閲屽憿錛熺湡鏄彲絎戯紒錛侊紒璇劇▼閮界緝姘寸緝鍒拌繖縐嶇▼搴︿簡錛岄偅榪樺紑浠</p> <p>涔堣鍛紝鑷嬈轟漢緗簡銆傜◢鏈夌偣鏈笓涓氱煡璇嗙殑浜轟篃涓嶈嚦浜庝細(xì)璁や負(fù)璁$畻鏈哄浘鍍忓鐞嗗氨鏄帺PS鍚с傞偅澶у閲屽</p> <p>鐢?shù)瀛愬伐绋嬬殑姣曚笟鍚庨兘鍘讳慨寰尝鐐夊Q岄氫俊宸ョ▼鐨勫幓鍗栫數(shù)璇濆崱錛屼俊鎭伐紼嬬殑灝卞幓鐓х浉棣嗗仛PS濂戒簡銆?br>鍞?#8230;…榪欏嚑澶╂鏄柊鐢熷叆瀛︼紝榪樼湅鐫涓鎵逛竴鎵圭殑鏂扮敓寰鎴戜滑瀹胯垗榪欒竟璧幫紝鎴戝績閲岀湡鏄毦榪囷紝鐪熸兂璺熶粬浠</p> <p>錛?#8220;鍥炲幓鍚э紝璇翠笉瀹氭潵騫磋繕鑳借冧釜娓呭崕銆?#8221;榪樻湁閭d箞澶氬闀匡紝閫佷釜瀛╁瓙涓婂ぇ瀛﹀涓嶅鏄擄紝浣嗕篃璁鎬粬浠繕涓嶇煡閬擄紝浠栦滑鐨勫効瀛愯鎺ュ彈榪欐牱鐨勬暀鑲層傛兂鐫榪欎簺浜嬶紝蹇冮兘鍦ㄧ棝鍟娿?br>   鎮(zhèn)?#8230;…</p><img src ="http://www.shnenglu.com/linyangfei/aggbug/60388.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/linyangfei/" target="_blank">椋為</a> 2008-08-29 18:43 <a href="http://www.shnenglu.com/linyangfei/archive/2008/08/29/60388.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>POJ 1112 Team Them Up! 姹傝ˉ鍥撅紝榪為氬垎閲忥紝DPhttp://www.shnenglu.com/linyangfei/archive/2008/08/08/58295.html椋為椋為Thu, 07 Aug 2008 16:51:00 GMThttp://www.shnenglu.com/linyangfei/archive/2008/08/08/58295.htmlhttp://www.shnenglu.com/linyangfei/comments/58295.htmlhttp://www.shnenglu.com/linyangfei/archive/2008/08/08/58295.html#Feedback1http://www.shnenglu.com/linyangfei/comments/commentRss/58295.htmlhttp://www.shnenglu.com/linyangfei/services/trackbacks/58295.html闃呰鍏ㄦ枃

椋為 2008-08-08 00:51 鍙戣〃璇勮
]]>
涓漢姣旇禌鏃跺績鐞嗙礌璐ㄤ笉濂?/title><link>http://www.shnenglu.com/linyangfei/archive/2008/08/04/57989.html</link><dc:creator>椋為</dc:creator><author>椋為</author><pubDate>Mon, 04 Aug 2008 10:33:00 GMT</pubDate><guid>http://www.shnenglu.com/linyangfei/archive/2008/08/04/57989.html</guid><wfw:comment>http://www.shnenglu.com/linyangfei/comments/57989.html</wfw:comment><comments>http://www.shnenglu.com/linyangfei/archive/2008/08/04/57989.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/linyangfei/comments/commentRss/57989.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/linyangfei/services/trackbacks/57989.html</trackback:ping><description><![CDATA[  <a >http://acm.tju.edu.cn/toj/vcontest/contest1688.html</a> <br>  浠婂ぉ鍋歭evel 1鐨勬瘮璧涘氨鍋氫簡涓閬搕rie鐨勯鐩傚悗鏉ヤ竴鐩磋鍥板湪G棰樹笂闈紝鎴戜竴鐩翠互涓篏棰樻湁鐘舵佸帇緙〥P鐨勬柟娉曪紝灝辨病鏈夊幓鎯沖叾浠栫殑鏂規(guī)硶浜嗐傚氨涓鐩村湪G姝誨驚鐜備絾璧涘悗璺熷ぇ鐗涗滑涓浜ゆ祦錛屽師鏉ヨ繖棰樻槸鐖嗘悶錛屽鏉傚害6^8銆傚氨鑺變簡10鍒嗛挓鎶婅繖棰樺垏浜嗐傚弽鎬濅粖澶╃殑姣旇禌錛屽叾瀹炲綋鏃跺鏋滆嚜宸卞皾璇曞埆鐨勬柟娉曪紝灝變笉浼?xì)涓鐩村洶鍦ㄨ繖閲屻傜壒鍒槸鐪嬪埌鍒漢榪囬鐨勬椂鍊欒嚜宸辨病榪囬錛屽績閲屽弽鍊掓槸瓚婃潵瓚婄揣寮狅紝鍒板悗闈㈠氨寰堜笉鐖戒簡銆傝剳瀛愰噷涔熷緢涔憋紝鑷繁閮借皟鏁翠笉榪囨潵銆傝繕鏈変粖澶╂瘮璧涚殑棰樼洰閮芥病璇伙紝瀹炲湪鏄笉搴旇銆?img src ="http://www.shnenglu.com/linyangfei/aggbug/57989.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/linyangfei/" target="_blank">椋為</a> 2008-08-04 18:33 <a href="http://www.shnenglu.com/linyangfei/archive/2008/08/04/57989.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>POJ 2047http://www.shnenglu.com/linyangfei/archive/2008/08/02/57811.html椋為椋為Sat, 02 Aug 2008 03:18:00 GMThttp://www.shnenglu.com/linyangfei/archive/2008/08/02/57811.htmlhttp://www.shnenglu.com/linyangfei/comments/57811.htmlhttp://www.shnenglu.com/linyangfei/archive/2008/08/02/57811.html#Feedback0http://www.shnenglu.com/linyangfei/comments/commentRss/57811.htmlhttp://www.shnenglu.com/linyangfei/services/trackbacks/57811.htmlConcert Hall Scheduling
Time Limit: 1000MS Memory Limit: 30000K
Total Submissions: 574 Accepted: 229

Description

You are appointed director of a famous concert hall, to save it from bankruptcy. The hall is very popular, and receives many requests to use its two fine rooms, but unfortunately the previous director was not very efficient, and it has been losing money for many years. The two rooms are of the same size and arrangement. Therefore, each applicant wishing to hold a concert asks for a room without specifying which. Each room can be used for only one concert per day.
In order to make more money, you have decided to abandon the previous fixed price policy, and rather let applicants specify the price they are ready to pay. Each application shall specify a period [i, j] and an asking price w, where i and j are respectively the first and last days of the period (1 <= i <= j <= 365), and w is a positive integer in yen, indicating the amount the applicant is willing to pay to use a room for the whole period.

You have received applications for the next year, and you should now choose the applications you will accept. Each application should be either accepted for its whole period or completely rejected. Each concert should use the same room during the whole applied period.

Considering the dire economic situation of the concert hall, artistic quality is to be ignored, and you should just try to maximize the total income for the whole year by accepting the most profitable applications.

Input

The input has multiple data sets, each starting with a line consisting of a single integer n, the number of applications in the data set. Then, it is followed by n lines, each of which represents one application with a period [i, j] and an asking price w yen in the following format.

i j w

A line containing a single zero indicates the end of the input.

The maximum number of applications in a data set is one thousand, and the maximum asking price is one million yen.

Output

For each data set, print a single line containing an integer, the maximum total income in yen for the data set.

Sample Input

4
1 2 10
2 3 10
3 3 10
1 3 10
6
1 20 1000
3 25 10000
5 15 5000
22 300 5500
10 295 9000
7 7 6000
8
32 251 2261
123 281 1339
211 235 5641
162 217 7273
22 139 7851
194 198 9190
119 274 878
122 173 8640
0

Sample Output

30
25500
38595

Source

 
    榪欓亾棰樼洰鏀句簡寰堜箙浜嗭紝涓鐩存病鎯沖嚭濂界殑瑙f硶銆傛渶榪戠殑鍑犳姣旇禌涓兘閬囧埌浜嗚繖閬撻錛屾瘮璧涘悗鎵嶆妸榪欓鎼炲畾銆傝繖棰樼殑鏂規(guī)硶鏄疍P銆傝緭鍏ユ暟鎹褰曡澶勭悊涓涓嬶紝寮涓涓?66澶х殑vector鏁扮粍錛岃褰曚簡鍒扮e澶╃粨鏉熸椂鐨勯煶涔愪細(xì)鐨勫紑濮嬫椂闂磗鍜屾敹鐩妛銆傚紑涓涓猟p[366][366]鐨勬暟緇勶紝鍏朵腑dp[i][j]琛ㄧず絎竴涓煶涔愬巺鍦ㄧi澶╋紝絎簩涓煶涔愬巺鍦ㄧj澶╂敹鍒扮殑yen銆傚洜涓洪瀹氱殑闊充箰浼?xì)鍗犵敤闊充箰鍘呮槸鏈変竴涓尯闂寸殑錛岃繖閲屽仛涓涓鐞嗭紝灝辨槸鍦ㄤ竴鍦洪煶涔愪細(xì)鍗犵敤鐨勬湡闂撮兘涓嶆敹閽憋紝鐩村埌涓涓煶涔愪細(xì)瀹屽叏緇撴潫鍚庢墠鏀墮挶銆傚彟澶栦袱涓煶涔愬巺鏄竴鏍風(fēng)殑錛屽嵆鏈鍚巇p[i][j]搴旇鏄竴涓縐版暟緇勶紝褰撳彧鎺ュ彈涓鍦洪煶涔愪細(xì)鐨勬儏鍐靛彲浠ュ己琛岀殑璁や負(fù)榪欏満闊充箰浼?xì)鏄攽譁ńW竴涓煶涔愬巺錛岃綆梔p[i][j]涓墍鏈塱>j鐨勫鹼紝鏈鍚庡啀浠p[j][i]=dp[i][j]鍗沖彲銆?br>
 1for(i=1; i<=365; i++)
 2        {
 3            for(jj=0; jj<hall[i].size(); jj++)
 4            {
 5                for(j=0; j<i; j++)
 6                {
 7                    dp[i][j]=Max(dp[i][j],dp[hall[i][jj].s-1][j]+hall[i][jj].w);
 8                }

 9                for(ii=jj+1; ii<hall[i].size(); ii++)
10                {
11                    dp[i][i]=Max(dp[i][i],dp[hall[i][jj].s-1][hall[i][ii].s-1]+
12                        hall[i][jj].w+hall[i][ii].w);
13                }

14            }

15            for(j=1; j<=i; j++)
16            {
17                dp[i][j]=Max(dp[i-1][j],dp[i][j]);
18                dp[i][j]=Max(dp[i][j-1],dp[i][j]);
19                dp[j][i]=dp[i][j];
20            }

21        }


椋為 2008-08-02 11:18 鍙戣〃璇勮
]]>
7鏈?6-7鏈?1鑽掑簾鐨勪竴鍛紒錛侊紒http://www.shnenglu.com/linyangfei/archive/2008/07/20/56710.html椋為椋為Sun, 20 Jul 2008 15:13:00 GMThttp://www.shnenglu.com/linyangfei/archive/2008/07/20/56710.htmlhttp://www.shnenglu.com/linyangfei/comments/56710.htmlhttp://www.shnenglu.com/linyangfei/archive/2008/07/20/56710.html#Feedback2http://www.shnenglu.com/linyangfei/comments/commentRss/56710.htmlhttp://www.shnenglu.com/linyangfei/services/trackbacks/56710.html    涓鍛ㄩ兘娌℃湁濂藉ソ鐨勫仛棰樸傚張紕頒笂瀛︽牎鐨勭綉緇滆窡鍗冨勾鑰佷箤榫熶技鐨勬參錛屼笂涓猵oj瑕佺瓑涓?鍒嗛挓錛屽仛姣旇禌榪欑閫熷害鎼炲緱涓鐐歸兘涓嶇埥銆傝繖鍛ㄥ悓瀛︽潵闀挎矙錛屾墍浠ユ垜鍘熸潵鍋氶鐨勮鍒掑叏琚墦涔憋紝涓嶈繃鍊掓槸閫涗簡闀挎矙濂藉鍦版柟錛屽懙鍛碉紙鏉ラ暱娌欎笁騫達(dá)紝絎竴嬈¤繖鏍蜂簡瑙i暱娌欙級銆傛殤鍋囩暀鍦ㄩ暱娌欏張涓嶆槸鐣欏湪榪欑帺鐨勶紝涓嬪懆鍚屽灝辮蛋浜嗭紝甯屾湜鑷繁鑳藉璋冩暣濂界姸鎬侊紝鐢ㄨ繖20澶╃殑鏃墮棿濂藉ソ鍐蹭竴鎶婏紝鍔犳補(bǔ)錛佸姞娌癸紒



椋為 2008-07-20 23:13 鍙戣〃璇勮
]]>
POJ 2335 嫻偣鏁扮殑gcdhttp://www.shnenglu.com/linyangfei/archive/2008/06/28/54874.html椋為椋為Sat, 28 Jun 2008 07:18:00 GMThttp://www.shnenglu.com/linyangfei/archive/2008/06/28/54874.htmlhttp://www.shnenglu.com/linyangfei/comments/54874.htmlhttp://www.shnenglu.com/linyangfei/archive/2008/06/28/54874.html#Feedback1http://www.shnenglu.com/linyangfei/comments/commentRss/54874.htmlhttp://www.shnenglu.com/linyangfei/services/trackbacks/54874.htmlTemple of Dune
Time Limit: 1000MS Memory Limit: 65536K
Total Submissions: 211 Accepted: 82

Description

The Archaeologists of the Current Millenium (ACM) now and then discover ancient artifacts located at the vertices of regular polygons. In general it is necessary to move one sand dune to uncover each artifact. After discovering three artifacts, the archaeologists wish to compute the minimum number of dunes that must be moved to uncover all of them.

Input

The first line of input contains a positive integer n, the number of test cases. Each test case consists of three pairs of real numbers giving the x and y coordinates of three vertices from a regular polygon.

Output

For each line of input, output a single integer stating the fewest vertices that such a polygon might have. You may assume that each input case gives three distinct vertices of a regular polygon with at most 200 vertices.

Sample Input

4
10.00000 0.00000 0.00000 -10.00000 -10.00000 0.00000
22.23086 0.42320 -4.87328 11.92822 1.76914 27.57680
156.71567 -13.63236 139.03195 -22.04236 137.96925 -11.70517
129.400249 -44.695226 122.278798 -53.696996 44.828427 -83.507917

Sample Output

4
6
23
100

Source



棰樼洰澶ф剰鏄粰鍑轟笁涓偣鐨?x,y)鍧愭爣錛岃姹傝緭鍑轟竴涓竟鏁版渶灝忕殑姝e杈瑰艦鐨勮竟鏁幫紝浣胯繖涓変釜鐐規(guī)伆濂藉湪

榪欎釜姝e杈瑰艦涓婇潰銆傚叾瀹炶繖涓笁瑙掑艦鍜岃繖涓澶氳竟褰㈡槸鍏卞鎺ュ渾錛岀敱澶栨帴鍦嗙殑鍦嗗績鍑哄彂錛屼笁瑙掑艦鐨勪笁

鏉¤竟鍙互鎶婂渾鍒嗘垚涓変喚錛屾瘡浠藉渾寮ф墍瀵瑰簲鐨勫渾蹇冭鍒嗗埆涓篴rg[0],arg[1]鍜宎rg[2]錛屾澶氳竟褰㈡妸鍦嗗姬

鍒嗘垚鐩哥瓑鐨刵浠斤紝姣忎喚瀵瑰簲鐨勫渾蹇冭涓?*pi/n銆傚叾瀹炰笁瑙掑艦鐨勪笁涓灝卞垎鍒崰鐢ㄤ簡鑻ュ共絳変喚姝e杈瑰艦

鎵鍒掑垎鐨勫渾寮э紝鏈鍚庝篃灝卞彧瑕佹眰arg[0],arg[1],arg[2]鍜?*pi鐨勬渶澶у叕綰︽暟(gcd)鍗沖彲銆備絾鏄繖閲屾槸

涓搴﹂兘鏄誕鐐規(guī)暟錛屾墍浠ヨ繕瀹氫箟涓涓誕鐐規(guī)暟鐨刧cd錛岃綆楁誕鐐規(guī)暟鐨刧cd鍙互鍒╃敤math.h鐨勫嚱鏁癴mod

(x,y)琛ㄧずx%y銆備緥濡?.5%0.3=0.2錛寈%y鐨勭粨鏋滀負(fù)涓嶈秴榪噛鐨勪竴涓誕鐐規(guī)暟銆備笅闈㈠啓浜嗕竴涓猣mod(x,y)鑷繁

鐨勫疄鐜般?br>double fmod(double x, double y)
{
 return x-floor(x/y)*y;
}
鏈変簡fmod鍑芥暟浠ュ悗錛屽氨鍙互鐢ㄥ畠鏉ユ眰gcd浜嗭紒
double fgcd(double a, double b)
{
 double t;
 if(dblcmp(a-b) == 1)  //a>b
 {
  t=a;
  a=b;
  b=t;
 }
 if(dblcmp(a) == 0) return b;
 return fgcd(fmod(b,a),a);
}



椋為 2008-06-28 15:18 鍙戣〃璇勮
]]>
Written to alpcs in Normalhttp://www.shnenglu.com/linyangfei/archive/2008/06/18/53935.html椋為椋為Wed, 18 Jun 2008 14:50:00 GMThttp://www.shnenglu.com/linyangfei/archive/2008/06/18/53935.htmlhttp://www.shnenglu.com/linyangfei/comments/53935.htmlhttp://www.shnenglu.com/linyangfei/archive/2008/06/18/53935.html#Feedback3http://www.shnenglu.com/linyangfei/comments/commentRss/53935.htmlhttp://www.shnenglu.com/linyangfei/services/trackbacks/53935.html   Last night alpc40 received a message and he told me sadly that two alpcs are eliminated from Normal, and he wasn’t willing to face up to the cruel reality. Actually the competition in alpcs also in ICPC is so fierce that every ACMers must do their best to improve themselves and to fight in every contest. Although it is so hard, I think that is why this contest attracts so many excellent programmers to join in the contest. I am sorry to hear that someone of you will lose your chances after these contests, but I want to remind you that every one no matter in Seed or Normal makes great effort. And you must realize that you are not as powerful as that Big Cows now. Someone who loses your chance does not mean that you lose all your chances in ICPC . If you really love it and want to do it, I think you mustn’t give it up. Because most of you are Sophomore or even freshmen, you still have many chances if and only if you work harder and learn more. ICPC is open to every body, and hope all of you will enjoy this game.



椋為 2008-06-18 22:50 鍙戣〃璇勮
]]>
婀栧ぇ閭璇瘋禌鎬葷粨http://www.shnenglu.com/linyangfei/archive/2008/05/26/51161.html椋為椋為Mon, 26 May 2008 10:00:00 GMThttp://www.shnenglu.com/linyangfei/archive/2008/05/26/51161.htmlhttp://www.shnenglu.com/linyangfei/comments/51161.htmlhttp://www.shnenglu.com/linyangfei/archive/2008/05/26/51161.html#Feedback0http://www.shnenglu.com/linyangfei/comments/commentRss/51161.htmlhttp://www.shnenglu.com/linyangfei/services/trackbacks/51161.html       榪欐鍘繪箹澶ф槸鍜?/span>alpc62榪樻湁alpc07涓緇勶紝鍦ㄨ禌鍓嶈繘琛岀殑涓ゆ娣樻卑璧涗腑錛屾垜浠粍鐨勮〃鐜板氨闈炲父涓嶅ソ錛屾渶鍚庝竴鍚嶃傚厛鍓嶇粍緇囩殑涓ゆ娣樻卑璧涗腑錛屾垜瑙夊緱鎴戜滑灝變竴鐩存病鏈夊垎濂介錛屾瘮璧涗腑灝變竴涓姴鍦伴捇鍒伴毦棰樹笂錛屼篃娌℃湁璁ょ湡鍦拌冭檻鍏朵粬鍙互AC鎺夌殑棰樼洰錛屾瘮璧涗竴寮濮嬪氨闄峰叆鍏朵腑錛岄毦棰樹笉鑳藉寰堝揩AC錛屽氨涓鐩村仠鐣欏湪涓涓涓婇潰錛屽緢涔呰繃鍚庢墠寮濮嬭窡棰橈紝鎵浠ラ犳垚浜嗗緢琚姩鐨勫眬闈€?/span>

       浠婂ぉ鍘繪箹澶ф垜璁や負(fù)灝辮閬垮厤鎴戜滑緇勫啀鍑虹幇榪欑鎯呭喌錛屼竴瀹氳璇婚錛岃澶氭兂棰橈紒澶ф竻鏃╁潗鏍¤濺涓璺鍏夌殑鍒頒簡婀栧ぇ錛堥暱娌欎粖澶╂悶鐏偓浼犻掗婕旓紝浜哄緢澶氾紝緇撴灉鏍¤濺鏃犺鏃佷漢鍦板紑浜嗚繃鍘伙級銆傜姣旇禌榪樻湁涓涓灝忔椂鐨勬椂闂淬傝繖鏃?/span>alpc62璺熸垜璇達(dá)紝浠栦粖澶╃殑鐘舵佷笉濂斤紝鏄ㄦ櫄鍋?/span>topcoder鍋氬埌寰堟櫄鎵嶇潯銆備簬鏄壘浜嗕釜鍦版柟澶х潯涓闃碉紝閱掓潵鍚庡氨綺劇楗辨弧鐨勮浠婂ぉ鍙互鏁查浜嗐?/span>

       棰樼洰鍗板埛鍦板緢涔憋紝鍒嗛鐨勬椂鍊欏氨涓漢鎾曚簡1/3鐨勯鐩?/span>Alpc62鍏堟嬁鍒頒簡A錛岀敤涓涓?/span>log鍑芥暟榪囨帀浜嗐傜劧鍚庢垜鐪嬮錛屽彂鐜頒竴涓腑鏂囧瓧絎︿覆DP棰橈紝鎴戣寰楀彲浠ュ仛錛屽氨璺?/span>62璇撮浜嗐?/span>62澶ф暡涓闃碉紝鎴戝氨涓鐩村湪鎵鵑鐩腑鐨?/span>trick錛屽洜涓烘垜鎰熻榪欓亾棰樻湁寰堝娌¤娓呮鐨勫湴鏂癸紝涓嶄箙紼嬪簭鍐欏畬錛屾病鍑烘牱渚嬶紝鐒跺悗鎴戜滑寮濮嬫鏌ワ紝鍙戠幇棰樼洰涓湁涓涓敊璇紝浜庢槸灝辮窇鍘葷綉欏典笂鐪嬶紝鎴戠殑澶╁晩錛佺綉欏典笂鐨勬弿榪板拰鎴戜滑鎵嬩笂鎷垮埌鐨勯鐩樊浜嗚繖涔堝錛屾寜鐓?/span>clarification涓婅鐨勪竴鍒囦互緗戦〉涓婄殑涓哄噯錛屼簬鏄垜浠鐫緗戦〉涓婄殑棰橈紝榪囦簡鏍蜂緥錛屼竴浜ゆ槸WA錛屾彁浜や簡鎵撳嵃浠g爜錛屼簬鏄?/span>62瑙夊緱瑕佹崲棰樸傝繖鏃?/span>alpc07璇諱簡涓閬撶寽鏁板瓧鐨勯錛屾垜浠垽鏂槸寮遍錛岀畝鍗曟毚鎼炲氨琛屻?/span>Alpc07涓婂幓鏁詫紝緇撴灉WA錛岃繖涓嬫悶寰楅儊闂蜂簡銆備笉綆℃垜浠張鎹㈤錛屾垜鍙堣浜嗗叏鍦烘渶澶氫漢榪囩殑涓閬撻錛屾垜寮濮嬭繕鍦ㄦ兂DP錛岃窡alpc62璇翠簡浠ュ悗錛屼粬姣笉鐘硅鮑鍦拌錛?/span>dijkstra鍢涳紝鏄叏騫存垚閮界儹韜禌鐨勫師棰樸傚緢蹇氨1A浜嗭紝榪囦簡榪欐椂alpc62鐨勪漢鍝佸氨鏆翠簡錛屽湪鍚稿彇浜嗗墠闈㈢殑鏁欒鍚庯紝鎴戜滑鎵撳紑緗戦〉錛岃鐪熻浜嗕笂闈㈢殑棰橈紝鍙戠幇alpc07鏁茬殑閭e埌棰樻槸鍥犱負(fù)璇誨叆鐨勬椂鍊欓敊浜嗭紝璇誨叆浠ヤ竴涓潪姝f暟緇撴潫錛岃屼笉鏄互錛?/span>1緇撴潫錛堣繖嬈℃瘮璧涢鐩湡鐨勫緢澶?/span>bug錛夈備簬鏄垜浠張鐬繃浜嗕竴棰樸傛帴涓嬫潵3棰樺仛寰楅兘寰堥『錛岄兘鏄?/span>alpc62緇?/span>1A浜嗐傛渶嬋鍔ㄧ殑鏄垜浠?/span>A浜?/span>6閬撻浠ュ悗錛屽紑濮?/span>WA鎺夌殑涓枃瀛楃涓?/span>DP棰樿rejudge浜嗭紝緇撴灉alpc62鐨勭▼搴忚繕鏄?/span>1A銆傞鐩暟鐬棿灝辨定鍒頒簡7棰樸傝繖鏃舵垜浠繕鏈変竴閬撳崥寮堝拰榪炶繛鐪嬫ā鎷熼錛屽崥寮堟垜鎺ㄤ簡鍗婂ぉ鍏紡錛岄兘鏄?/span>WA錛屽叾瀹炴垜鍒扮幇鍦ㄩ兘鎼炰笉娓呮鍗氬紙鐨勫師鐞?#8230;…榪炶繛鐪嬫ā鎷熼錛屾垜瑙夊緱鑷繁鍙互鍋氾紝浣嗘槸鐢變簬棰樼洰娌℃湁鎻忚堪娓呮錛屾垜鏈夊緢澶氱粏鑺傜殑鍦版柟娌℃湁鑰冭檻娓呮錛屾病鏁層傛渶鍚庝竴涓皬鏃剁殑鏃墮棿灝辨槸alpc62鍜?/span>alpc07涓や釜浜哄湪寮?/span>RSA銆傚啓浜嗗ソ涔咃紝蹇埌姣旇禌緇撴潫浜嗭紝alpc62鍙戠幇鑷繁娌℃湁甯︽ā鐗堜簡錛屾渶鍚庤繖閬撻娌″嚭錛屾瘮璧涚粨鏉燂紝鎴戜滑鏄?/span>7閬撻銆?/span>

       浠婂ぉ鍦ㄦ瘮璧涗腑錛屾垜鍩烘湰涓婃病鏈夋暡棰橈紝鍦ㄧ粍閲岄潰鍗忚皟鍒嗛錛屾敞鎰忓満涓婄殑褰㈠娍銆傚氨鍦ㄨ繖嬈$殑姣旇禌涓垜瑙夊緱璇婚瀵逛簬涓涓槦浼嶆潵璇村緢閲嶈銆傜壒鍒槸鎯寵鍑?/span>1A錛?/span>1A鐨勬椂鍊欏彲浠ラ紦鑸為槦浼嶇殑澹皵錛屼篃涓嶄細(xì)璁╁ぇ瀹惰涓閬撻鐩粰緙犱綇銆傚彟澶栦篃鍙互鑺傜渷寰堝鏃墮棿錛岃繃棰樹互鍚庯紝鍙互鎶涘純濂藉鐨勮礋鎷咃紝鍏ㄥ姏鎶曞叆鍒頒笅涓閬撻鐩腑鍘匯傚浜庝粖澶╂瘮璧涜繖鏍風(fēng)殑棰樼洰錛岃棰樻槸鍏抽敭銆傞鐩笉鏄緢闅劇殑鎯呭喌涓嬶紝鍦ㄨ棰樹腑鍙互鍙戠幇寰堝瀹規(guī)槗鍗℃椂鐨勭粏鑺傘傛瘮濡傝緭鍏ヨ緭鍑烘牸寮忥紝鏁版嵁鑼冨洿錛岄鐩腑鍐楅暱鐨勫簾璇濓紝鐗規(guī)畩鎯呭喌鐨勮鏄?#8230;…榪欎簺閮芥槸鍦ㄦ暡棰樼殑鏃跺欒娉ㄦ剰鐨勩傝棰樿涓嶅ソ鍦ㄥ墠涓ゆ姣旇禌涓兘鍚冧簡寰堝ぇ鐨勪簭錛屼粖澶╄嚜璁や負(fù)璇婚鐨勬儏鍐佃繕涓嶉敊錛屾瘮璧涗腑闂寸殑閭f涔熷仛寰楀緢欏哄埄銆傞櫎姝や箣澶栵紝浠婂ぉ鍦ㄦ瘮璧涗腑鎴戠殑鏀惰幏榪樻湁灝辨槸鐪?/span>alpc62澶х墰鏁查錛屾垜瑙夊緱浠栧湪鏁查鐨勬椂鍊欐濊礬寰堟竻妤氾紝鑴戝瓙鎯沖緱寰堝揩銆傛劅瑙変粬鏁查鐨勬椂鍊欏氨涓撳績鐨勭啍鍏ュ埌棰樼洰涔嬩腑浜嗭紝鎬濈淮涓鐩撮兘寰堣繛璐紝鑰屼笖瀵硅嚜宸變唬鐮佺殑椹鵑┉鑳藉姏寰堝己銆傛垜瑙夊緱榪欎簺涔熸槸鎴戣鍦ㄤ互鍚庣殑緇冧範(fàn)涓鍔犲己鐨勩?/span>



椋為 2008-05-26 18:00 鍙戣〃璇勮
]]>
鏍?wèi)迮濪P PKU 1947 Rebuilding Roadshttp://www.shnenglu.com/linyangfei/archive/2008/05/05/48913.html椋為椋為Mon, 05 May 2008 09:38:00 GMThttp://www.shnenglu.com/linyangfei/archive/2008/05/05/48913.htmlhttp://www.shnenglu.com/linyangfei/comments/48913.htmlhttp://www.shnenglu.com/linyangfei/archive/2008/05/05/48913.html#Feedback0http://www.shnenglu.com/linyangfei/comments/commentRss/48913.htmlhttp://www.shnenglu.com/linyangfei/services/trackbacks/48913.htmlRebuilding Roads
Time Limit: 1000MS Memory Limit: 30000K
Total Submissions: 1146 Accepted: 390

Description

The cows have reconstructed Farmer John's farm, with its N barns (1 <= N <= 150, number 1..N) after the terrible earthquake last May. The cows didn't have time to rebuild any extra roads, so now there is exactly one way to get from any given barn to any other barn. Thus, the farm transportation system can be represented as a tree.

Farmer John wants to know how much damage another earthquake could do. He wants to know the minimum number of roads whose destruction would isolate a subtree of exactly P (1 <= P <= N) barns from the rest of the barns.

Input

* Line 1: Two integers, N and P

* Lines 2..N: N-1 lines, each with two integers I and J. Node I is node J's parent in the tree of roads.

Output

A single line containing the integer that is the minimum number of roads that need to be destroyed for a subtree of P nodes to be isolated.

Sample Input

11 6
1 2
1 3
1 4
1 5
2 6
2 7
2 8
4 9
4 10
4 11

Sample Output

2

Hint

[A subtree with nodes (1, 2, 3, 6, 7, 8) will become isolated if roads 1-4 and 1-5 are destroyed.]

Source



    棰樼洰緇欏嚭浜嗕竴涓爲(wèi)鑺傜偣鏁頒負(fù)n錛岃姹傚幓鎺夋渶灝戠殑杈癸紝寰楀嚭涓涓瓙鏍?wèi)锛屼娇寰棙q欎釜瀛愭爲(wèi)鐨勮妭鐐規(guī)爲(wèi)涓簃銆?br>    棣栧厛榪欐槸涓媯墊棤鏍規(guī)爲(wèi)錛屼換鎰忎竴涓妭鐐歸兘鍙互浣滀負(fù)鏍廣傝繖閲屽氨鍘?鍙瘋妭鐐逛負(fù)鏍廣傝冭檻闄ゆ牴鑺傜偣澶栵紝鏍?wèi)涓殑姣忎竴涓妭鐐廣備竴縐嶆儏鍐墊槸鍦╠fs鏃訛紝璇ヨ妭鐐硅劚紱誨畠鐨勭埗鑺傜偣錛岀敱瀹冨拰瀹冪殑瀛愯妭鐐瑰叡鍚岀粍鎴愪竴媯靛瓙鏍?wèi)锛寴q欐牱瑕佹妸杈瑰垹鎺夛紱鍙︿竴縐嶆儏鍐墊槸淇濇寔璇ヨ妭鐐逛笌鍏剁埗鑺傜偣鐨勮繛鎺ワ紝涓嶈鍒犺竟銆傚湪鍋歞fs鐨勬椂鍊欙紝瀵逛簬褰撳墠鑺傜偣v錛岃綆楁墍鏈夊瓙鑺傜偣浜х敓鐨刣p鍊箋俤p[i][j]琛ㄧず絎琲涓妭鐐逛負(fù)鏍癸紝鐢熸垚鑺傜偣鏁頒負(fù)j鐨勫瓙鏍?wèi)鎵闇瑕佸垹鎺夌殑鏈灝忚竟鐨勬潯鏁般傛渶鍚庤繕瑕佹敞鎰忔暣棰楁爲(wèi)鐨勬牴鑺傜偣鍥犱負(fù)瀹冩病鏈夌埗鑺傜偣錛屾墍浠ヤ笉鐢ㄨ綆楀垹闄ょ殑杈廣?br>    dfs鍋歞p鐨勮繃紼嬪涓嬶細(xì)
 1void search(int v)
 2{
 3    int i,j,k,t;
 4    mark[v]=true;
 5    dp[v][0]=1;
 6    dp[v][num[v]]=0;
 7    for(i=1; i<=n; i++)
 8    {
 9        if(g[v][i] && !mark[i])
10        {
11            search(i);
12            for(j=1; j<=num[v]; j++)
13            {
14                if(dp[v][j] != INF)
15                {
16                    for(k=0; k<=num[i]; k++)
17                    {
18                        if(dp[i][k] != INF)
19                        {
20                            t=dp[v][j-(num[i]-k)];
21                            dp[v][j-(num[i]-k)]=Min(t,dp[v][j]+dp[i][k]);
22                        }

23                    }

24                }

25            }

26        }

27    }

28}

29
30int main()
31{
32    int i,j,a,b;
33    //freopen("in.txt","r",stdin);
34    scanf("%d%d",&n,&m);
35    memset(g,false,sizeof(g));
36    memset(num,0,sizeof(num));
37    for(i=1; i<=n; i++)
38        for(j=1; j<=n; j++)
39            dp[i][j]=INF;
40    for(i=1; i<n; i++)
41    {
42        scanf("%d%d",&a,&b);
43        g[a][b]=g[b][a]=true;
44    }

45    memset(mark,false,sizeof(mark));
46    dfs(1);
47    memset(mark,false,sizeof(mark));
48    search(1);
49    a=INF;
50    for(i=1; i<=n; i++)
51    {
52        //for(j=1; j<=num[i]; j++)
53        //{
54            b=dp[i][m];
55            if(i != 1)
56                b++;
57            if(b < a)
58                a=b;
59        //}
60    }

61    printf("%d\n",a);
62    return 0;
63}


椋為 2008-05-05 17:38 鍙戣〃璇勮
]]>
涓崡璧涚粨鏉熶簡http://www.shnenglu.com/linyangfei/archive/2008/04/30/48532.html椋為椋為Wed, 30 Apr 2008 09:34:00 GMThttp://www.shnenglu.com/linyangfei/archive/2008/04/30/48532.htmlhttp://www.shnenglu.com/linyangfei/comments/48532.htmlhttp://www.shnenglu.com/linyangfei/archive/2008/04/30/48532.html#Feedback2http://www.shnenglu.com/linyangfei/comments/commentRss/48532.htmlhttp://www.shnenglu.com/linyangfei/services/trackbacks/48532.html    涓崡璧涚粨鏉熶簡錛岀粨鏋滃嚭涔庢剰鏂欍傚ぇ瀹跺湪鍦轟笂閮芥病鍙戞尌濂姐傛垜浠粍鏄痑lpc T8錛屾瘮璧涘紑濮?/p>

鐨勬椂鍊欏垎棰橈紝鎴戣DEF錛屽緢蹇垜灝卞彂鐜頒簡E鏄竴閬撴按棰橈紝涓婃墜灝辨暡錛屾祴璇曚簡鍑犱釜鏁版嵁涔嬪悗灝?/p>

submit浜嗐傞仐鎲懼晩錛岃繖灝辨槸鎴戜滑緇勮繖鍦烘瘮璧涘敮涓鐨勪竴涓?/Y銆傚湪涓崡璧涘墠澶滐紝鎴戣繕鍦ㄦ兂鏈夊敖

閲忓鐨?/Y錛屼竴涓婂満榪欎箞蹇氨姘磋繃浜嗕竴閬撻錛屾垜榪樹互涓轟粖澶╃殑棰樼洰寰堢畝鍗曘傚綋鏃剁殑蹇冩儏閭d釜

嬋鍔ㄥ晩……榪囬鍚庢垜鍙堢珛椹D棰橈紝鐪嬭搗鏉ュ緢鍍忎竴閬撴ā鎷熼錛屾垜鑷俊鍦拌涓鴻繖棰樿窡E涓鏍鳳紝

椹笂鍙堝紑濮嬫暡浠g爜錛屾暡鐫鏁茬潃灝卞彂鐜頒笉瀵逛簡錛屾暟鎹噺杈懼埌浜?00000錛屾毚鎼炵殑璇濅細(xì)瓚呮椂錛屾垜

鎰忚瘑鍒拌繖閬撻涓嶅厜鏄函綺圭殑妯℃嫙錛屽簲璇ヨ鍊熷姪浜庝簺鏁版嵁緇撴瀯鐨勪簡銆傛垜浠粍鏀炬參浜嗚剼姝ャ?/p>

alpc40鍜宎lpc43浠嶅湪璇婚錛屾帴鐫alpc40璺熸垜璁睠棰橈紝700涓偣涓夊嚭涓変釜鐐癸紝浣垮緱榪欎笁涓偣

紜畾鐨勫鎺ュ渾鍗婂緞鏈澶с侽(n^3)鐨勬椂闂翠細(xì)瓚呮椂錛屼簬鏄垜鍙堜竴嬈′笉鍔犳濈儲鍦拌“紿佸寘”錛屽叴

鑷村媰鍕冨湴鏁蹭簡涓獊鍖咃紝緇撴灉WA銆傛墦鍗頒唬鐮侊紝浠ヤ負(fù)鏄垜鐨勭獊鍖呴敊浜嗭紝鍐嶆敼錛屽啀WA銆傝繖鏃跺凡緇?/p>

涓や釜澶氬皬鏃惰繃鍘諱簡錛屾垜浠繕鏄竴涓皵鐞冦備竴嬈℃鐨刉A璁╂垜鍐烽潤涓嬫潵鎯籌紝闂娌¤繖涔堢畝鍗曪紝

鍚庢潵璁ㄨ鍙戠幇鍏堟眰紿佸寘錛屽啀鏋氫婦鐐圭殑鏂規(guī)硶鏄敊鐨勩傚仛浜嗕袱涓灝忔椂鐨勭畻娉曚粠鏍規(guī)湰涓婃槸閿欑殑

錛屽綋鏃舵垜灝遍鎰熷埌姣旇禌鍚庣殑緇撴灉浜嗐傛渶鍚庢暡浜嗕釜O(n^3)鐨勬毚鎼烇紝TLE銆傛鏃舵垜宸茬粡鏀懼純浜嗐?/p>

姣旇禌涓綔涓轟竴涓富鍔涳紝鎴戣寰楁垜鐨勮〃鐜板疄鍦ㄦ槸澶樊浜嗭紝娌℃湁璁ょ湡鍦拌璁哄拰鍒嗘瀽灝辨暡棰橈紝澶?/p>

閮ㄥ垎鏃墮棿鍗犵敤鐫閿洏錛屼互鑷翠簬alpc43鏁村満姣旇禌閮芥病鏈夌鍒伴敭鐩樸傜粍闃熻禌鍙樻垚浜嗘垜鐨勪釜浜鴻禌

錛屽茍娌℃湁鍙戞尌涓変釜浜虹殑鍚堝姏銆傜壒鍒槸鍒頒簡鏈鍚?5鍒嗛挓錛屽彉鎴愪簡鍨冨溇鏃墮棿錛屾病棰樺彲鍋氫簡錛屾垜

浠紑濮嬭竟鍚冩眽鍫★紝杈瑰埛rank list……
    鎬葷粨榪欐姣旇禌錛岄鍏堟槸鎴戯紝鍦轟笂鐨勭粡楠岃繕涓嶈凍銆傛瘮濡傚湪榪欐姣旇禌涓満涓婂嚭鐜頒簡娌¢鍋?/p>

錛岀畻娉曢敊璇瓑鑷村懡鐨勬儏鍐墊椂錛屾垜瀹屽叏灝變笉鑳芥帶鍒惰繖鏍風(fēng)殑灞闈紝鍐插姩錛?gt;澶辮惤->鏀懼純錛屽湪緇勯槦

璧涗腑寰堝繉璁沖嚭鐜拌繖鏍風(fēng)殑鎯呭艦銆傛瘮璧涚殑鏃跺欏拰騫蟲椂鍋氶閮戒笉涓鏍鳳紝褰撴椂鑴戝瓙灝卞緢娣蜂貢錛屽啀涔?/p>

娌″績鎬濇兂鍏朵粬鐨勯鐩簡銆傚彟澶栦篃鏄嚜宸辯殑瀹炲姏鍘熷洜錛屽棰樼洰鎶婃彙寰椾笉濂姐傚浜庢垜浠粍錛屾垜

瑙夊緱浜掔浉鐨勪氦嫻佸拰璁ㄨ榪樻湁寰呮敼榪涳紝鏈夋椂璇撮鎰忥紝瀵規(guī)柟寰堥毦棰嗕細(xì)錛屾瘮璧涗腑鐨勮璁轟篃娌″嚭鐜?/p>

鏈夋剰涔夌殑浜偣銆?br>    alpcs閮藉湪濂藉ソ鍦板弽鎬濆弽鎬濆啀鍙嶆?#8230;…涔熻緇欐垜鑷繁鐨勬満浼?xì)迤堜笉澶氬Q岃鐪熷仛濂芥瘡涓鍦烘瘮

璧涳紝姣忓満姣旇禌閮借鏈夋敹鑾楓?/p>

椋為 2008-04-30 17:34 鍙戣〃璇勮
]]>
涓崡璧涘墠澶?/title><link>http://www.shnenglu.com/linyangfei/archive/2008/04/26/48204.html</link><dc:creator>椋為</dc:creator><author>椋為</author><pubDate>Sat, 26 Apr 2008 13:01:00 GMT</pubDate><guid>http://www.shnenglu.com/linyangfei/archive/2008/04/26/48204.html</guid><wfw:comment>http://www.shnenglu.com/linyangfei/comments/48204.html</wfw:comment><comments>http://www.shnenglu.com/linyangfei/archive/2008/04/26/48204.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.shnenglu.com/linyangfei/comments/commentRss/48204.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/linyangfei/services/trackbacks/48204.html</trackback:ping><description><![CDATA[<p>    鏄庡ぉ灝辨槸涓崡璧涗簡錛屽幓騫撮変簡鍗佺粍錛屽洜涓哄綋鏃惰嚜宸卞疄鍔涘お鑿滐紝娌℃湁鏈轟細(xì)鑳藉鍙傚姞銆傜粡</p> <p>榪囦簡涓騫寸殑鍔姏錛屼粖騫村彇寰椾簡榪欎釜鏈轟細(xì)銆傚拰鎴戝悓緇勭殑榪樻湁alpc40鍜宎lpc43銆傛垜浠鉤鏃惰繕閮?/p> <p>姣旇緝浜嗚В浜嗐俛lpc40鍜屾垜鏄竴涓鑸嶇殑錛屽鉤鏃跺仛棰樼殑浜ゆ祦涔熸瘮杈冨錛屾垜浠袱鍐欑▼搴忕殑椋庢牸</p> <p>涔熷樊涓嶅錛堜竴涓佸笀鏁欑殑鍢沕_^錛夈傛垜瑙夊緱alpc40鍦ㄥ仛鏁板棰橈紝鎵捐寰嬬殑棰樼洰鏃惰繕鏄緢蹇兘</p> <p>鎵懼埌鏂規(guī)硶鐨勶紝鍦ㄦ瘮璧涚殑鏃跺欙紝浠栨瘮杈冨枩嬈㈣嚜宸卞嚭鏁版嵁錛屾暡瀹岄鍚庢繪槸涓嶆柇鍦板嚭鏁版嵁鏉ユ楠?/p> <p>鑷繁鐨勭▼搴忥紝鍦ㄦ牎璧涗腑灝辯湅鍑轟簡錛岃櫧鐒朵粬浜ら鐨勬椂闂翠笉鏄渶鏃╃殑錛屽洜涓轟粬涓鐩村湪鍑烘暟鎹祴</p> <p>璇曡嚜宸辯殑紼嬪簭錛屼竴鐩存祴鍒拌嚜宸辮涓烘病鏈夐棶棰樹簡錛屾墠鎻愪氦錛屽緢澶ф鐜囧嚭1/Y鐨勩傛墍浠ュ敖綆′氦棰?/p> <p>涓嶅揩錛屼絾鍥犻敊寰楀皯錛岀綒鏃跺皯錛屾牎璧涙椂鍦ㄥ悓鏍烽鐩暟鐨勪漢涓繕鏄帓鍦ㄤ簡鍓嶉潰銆傛垜瑙夊緱榪欑偣闈?/p> <p>甯稿ソ錛屽湪鏄庡ぉ鐨勬瘮璧涗腑錛屾垜浠鍏堣姹傜ǔ銆傛垜瑙夊緱鎴戜滑鐨勫疄鍔涚粷瀵逛笉鑷充簬寮哄埌鎶婃墍鏈夌殑棰?/p> <p>鐩兘鍋氬嚭鏉ワ紝涔熶笉瑙佸緱浼?xì)姣斿埆錆h澶氬嚭棰橈紝鎵浠ュ湪寰堝鍚屾牱棰樼洰鏁扮殑浜轟腑錛岃繕鏄鎷肩綒鏃剁殑</p> <p>銆傝繖灝遍渶瑕佸湪姣旇禌涓仛鐨勭ǔ錛屼簤鍙栧敖閲忓鐨?/Y銆傛垜涔熻鍏嬫湇騫蟲椂姣旇緝鎬ヨ簛鐨勪範(fàn)鎯紝鍒囧繉涓?/p> <p>瑕佷竴鍑烘牱渚嬪氨浜わ紝鍥為【涓涓嬭嚜宸辯殑紼嬪簭錛屾祴璇曚竴涓嬫暟鎹紝鏌ユ壘閿欒銆傝繖涓ゆ姣旇禌鐪嬩簡</p> <p>alpc43鐨勪唬鐮侊紝鎴戣寰椾粬鐨勪唬鐮佸疄鍦ㄦ槸寰堜貢錛屽緢澶氱緝榪涳紝鎹㈣閮界敤寰椾笉瑙勮寖錛屽啓紼嬪簭鐨勬椂</p> <p>鍊欏鏄撻犳垚鎬濊礬涓嶆竻鏅幫紝鍦ㄦ鏌ョ▼搴忕殑鏃跺欎篃寰堥毦鍙戠幇閿欒錛屼細(xì)嫻垂寰堝鏃墮棿銆傛垜瑙夊緱姣?/p> <p>璧涗腑錛岀粰alpc43鍋氫簺浠g爜閲忎笉澶э紝浣嗘槸鎬濊礬鑳藉鍑烘潵寰楁瘮杈冩竻鏅扮殑棰樼洰銆傝嚦浜庢垜錛屾垜瑙夊緱</p> <p>搴旇鎷呰搗澶ч噺鐨勪唬鐮佷換鍔★紝鍦ㄧ粍閲岋紝鎴戠殑浠g爜閫熷害榪樺彲浠ャ傚彲浠ュ啓鐐逛唬鐮侀噺澶х殑妯℃嫙棰橈紝</p> <p>灝介噺蹇湴AC錛屽ソ涓烘垜浠粍鑺傜渷鏃墮棿銆傚彟澶栵紝涓浜涜璁$畻娉曪紝鏁版嵁緇撴瀯鐨勯鐩紙緗戠粶嫻侊紝浜?/p> <p>鍒嗗浘錛岄珮綺懼害錛岀嚎孌墊爲(wèi)錛岃綆楀嚑浣曠瓑錛夛紝鎴戜篃瑕佹暡鏁詫紝浜夊彇鑳藉啿鍑烘洿澶氱殑棰樸?br>    浠庝粖澶╃殑鐑韓璧涙潵鐪嬶紝鎴戠殑鐘舵佷竴鐐歸兘涓嶅ソ銆傚彲鑳芥槸榪欎釜鏄熸湡錛屽張瑕佸仛棰橈紝鍙堣鑰冭瘯</p> <p>錛岃繕瑕佺粍緇囨暟鎹簱鐨勫涔?fàn)锛屾湁鐐规悶寰楀お绡忎簡銆傚氨鍐欒繖涔堢偣浜嗭紝浠婃櫄浼戞伅濂界偣錛屼絾鎰挎槑澶╄兘</p> <p>淇濇寔鏈浣崇殑鐘舵乛_^</p><img src ="http://www.shnenglu.com/linyangfei/aggbug/48204.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/linyangfei/" target="_blank">椋為</a> 2008-04-26 21:01 <a href="http://www.shnenglu.com/linyangfei/archive/2008/04/26/48204.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>涓嶇敤IDE鐨勭粨鏋?/title><link>http://www.shnenglu.com/linyangfei/archive/2008/04/21/47757.html</link><dc:creator>椋為</dc:creator><author>椋為</author><pubDate>Mon, 21 Apr 2008 12:19:00 GMT</pubDate><guid>http://www.shnenglu.com/linyangfei/archive/2008/04/21/47757.html</guid><wfw:comment>http://www.shnenglu.com/linyangfei/comments/47757.html</wfw:comment><comments>http://www.shnenglu.com/linyangfei/archive/2008/04/21/47757.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://www.shnenglu.com/linyangfei/comments/commentRss/47757.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/linyangfei/services/trackbacks/47757.html</trackback:ping><description><![CDATA[<div id="hvzpftn" class=ptt lang=en-US>   鐜板湪鏀圭敤UltraEdit鏁查錛実++緙栬瘧銆傚ソ涓嶉傚簲錛屽洜涓烘病浜哣C鐨勮皟璇曞姛鑳斤紝涔熸病鏈変簡IDE寮瑰嚭浠g爜鐨勫姛鑳姐傝嚜宸辨暡錛岄敊浜嗚鑷繁媯鏌ャ備粖澶╂暡棰樺氨鍚冧簡浜忥紝鍒ゆ柇涓涓瓧絎﹁鍦╬-z涔嬮棿錛岀粨鏋滄垜鍐欐垚浜唓-z錛岄犳垚浜嗘棤灝界殑WA……鍚庢潵榪樻槸蹇嶄笉浣忥紝鍦╒C鐨勫府鍔╀笅AC鐨勩備笉鐢╒C鐨勬棩瀛愶紝榪囬亾棰樿繕鐪熶笉瀹規(guī)槗鍟娿傛墍浠ョ幇鍦ㄩ兘娌℃湁鍕囨皵鎸戞垬3KB Code 鐨勪唬鐮佷簡銆傛諱箣錛岃嚜宸辮繕瑕佹參鎱㈤傚簲錛岃繕瑕佷竴鐐圭偣榪涙銆?/div><img src ="http://www.shnenglu.com/linyangfei/aggbug/47757.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/linyangfei/" target="_blank">椋為</a> 2008-04-21 20:19 <a href="http://www.shnenglu.com/linyangfei/archive/2008/04/21/47757.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>榪唬鍔犳繁鎼滅儲http://www.shnenglu.com/linyangfei/archive/2008/04/20/47664.html椋為椋為Sun, 20 Apr 2008 07:44:00 GMThttp://www.shnenglu.com/linyangfei/archive/2008/04/20/47664.htmlhttp://www.shnenglu.com/linyangfei/comments/47664.htmlhttp://www.shnenglu.com/linyangfei/archive/2008/04/20/47664.html#Feedback1http://www.shnenglu.com/linyangfei/comments/commentRss/47664.htmlhttp://www.shnenglu.com/linyangfei/services/trackbacks/47664.htmlThe Rotation Game

Time Limit: 15000MS

 

Memory Limit: 150000K

Total Submissions: 944

 

Accepted: 218

Description

The rotation game uses a # shaped board, which can hold 24 pieces of square blocks (see Fig.1). The blocks are marked with symbols 1, 2 and 3, with exactly 8 pieces of each kind.


Initially, the blocks are placed on the board randomly. Your task is to move the blocks so that the eight blocks placed in the center square have the same symbol marked. There is only one type of valid move, which is to rotate one of the four lines, each consisting of seven blocks. That is, six blocks in the line are moved towards the head by one block and the head block is moved to the end of the line. The eight possible moves are marked with capital letters A to H. Figure 1 illustrates two consecutive moves, move A and move C from some initial configuration.

Input

The input consists of no more than 30 test cases. Each test case has only one line that contains 24 numbers, which are the symbols of the blocks in the initial configuration. The rows of blocks are listed from top to bottom. For each row the blocks are listed from left to right. The numbers are separated by spaces. For example, the first test case in the sample input corresponds to the initial configuration in Fig.1. There are no blank lines between cases. There is a line containing a single `0' after the last test case that ends the input.

Output

For each test case, you must output two lines. The first line contains all the moves needed to reach the final configuration. Each move is a letter, ranging from `A' to `H', and there should not be any spaces between the letters in the line. If no moves are needed, output `No moves needed' instead. In the second line, you must output the symbol of the blocks in the center square after these moves. If there are several possible solutions, you must output the one that uses the least number of moves. If there is still more than one possible solution, you must output the solution that is smallest in dictionary order for the letters of the moves. There is no need to output blank lines between cases.

Sample Input

1 1 1 1 3 2 3 2 3 1 3 2 2 3 1 2 2 2 3 1 2 1 3 3
1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3
0

Sample Output

AC
2
DDHH
2

Source

Shanghai 2004

 

 

鍥句腑鐨?/span>#瀛楁牸鐨?/span>4鏉$珫綰匡紝鍙互鎸?/span>8涓柟鍚戝掕漿閲岄潰鐨勬暟瀛楁柟鍧楋紝褰撲腑闂寸殑8涓暟瀛楁柟鍧楁槸鍚屼竴涓暟瀛楁椂錛屾父鎴忕粨鏉熴傝繖閬撻灝辮姹傛悳绱竴涓渶鐭礬寰勶紝鍊掕漿8涓柟鍚戜嬌寰椾腑闂?/span>8涓暟瀛楃浉絳夈傝繖閬撻鐩湅璧鋒潵寰堝儚涓閬撳崟綰殑BFS錛岀湅浜?/span>POJ閲岄潰璇?/span>BFS浼?xì)鐖嗗唴瀛樺Q屾垜娌¤瘯錛屼及璁″啓寰楀ソ鐨勪篃鐖嗕笉浜嗐備絾鏄及璁″啓BFS榪樿娑夊強(qiáng)鍒扮姸鎬佺殑鍒ら噸錛岀▼搴忓啓璧鋒潵涔熶笉鏂逛究銆傛垜鐢ㄤ簡榪唬鍔犳繁鐨勬悳绱㈡柟娉曘傜涓嬈℃帴瑙﹁繖涓畻娉曪紝鎴戣涓涓嬫垜鐨勭悊瑙o細(xì)

       鍘熸潵鎴戝緢涓嶇悊瑙h凱浠e姞娣憋紝鎼滅儲鐨勬繁搴︿竴灞備竴灞傚湴鍔狅紝鍦ㄥ悗闈㈢殑鏌愪竴娣卞害闄愬埗涓嬫悳绱紝蹇呭畾浼?xì)鎼滃埌鍓嶉潰娣卞害鎵鑳芥悳鍒扮殑緇撴灉錛岃繖浼?xì)閫犳垚閲嶅鎼滅儲銆傚熀浜庤繖鐐癸紝鎴戜竴鐩撮兘璁や負(fù)榪唬鍔犳繁鎼滅儲鐨勬柟娉曞緢鍐椾綑錛屽綋鐒朵篃鏄嚜宸變粠鏉ラ兘娌℃湁鍔ㄦ墜璇曡繃銆傚儚榪欓亾棰樺氨緇欐垜鐨勬敹鑾蜂笉灝戯紝鏈夌殑鏃跺欓夋嫨涓瀹氱殑絳栫暐榪涜鎼滅儲錛屾垜浠槸寰堥毦紜畾瑙f墍鍦ㄧ姸鎬佺┖闂寸殑娣卞害鐨勶紝鏈夋椂鍙兘瑙g殑娣卞害涓嶅ぇ錛屼絾鏁翠釜鐘舵佺┖闂寸殑娣卞害寰堝ぇ錛岀洸鐩殑dfs鎼滅儲鍦ㄧ姸鎬佺┖闂撮噷灝辨湁鍙兘浼?xì)瓒婇櫙偠婃繁锛寴q熻繜鍑轟笉浜嗚В錛屽悓鏃舵暣涓姸鎬佺┖闂寸殑瀹藉害涔熷緢澶э紝鐢?/span>BFS鍙兘灝變細(xì)鐖嗙┖闂淬傝凱浠e姞娣辨悳绱㈡伆鎭版槸鍙栦簡涓涓姌涓傚埄鐢ㄤ簡dfs鐨勪紭鍔匡紝闄愬埗浜嗘悳绱㈢殑娣卞害錛岄伩鍏嶄簡鍑虹幇鏃犺В鐨勫鍦般傜敱浜庢繁搴︽槸閫愪釜澧炲姞鐨勶紝褰撴悳鍒頒竴涓В鍚庡氨閫鍑猴紝鎵浠ラ伩鍏嶄簡BFS涓垽閲嶇殑涓姝ユ搷浣滐紝褰撶劧鍦ㄨ凱浠f繁鎼滅殑榪囩▼涓紝榪樺彲浠ュ姞鍏ュ壀鏋濓紝鍙互浼樺寲紼嬪簭銆備絾鏄垜鐨勭▼搴忓湪POJ涓婅繕涓嶅揩錛岃繕瑕佹壘鎵懼師鍥狅紝涔熻榪樻湁浼樺寲銆備笅闈㈡槸涓浜涘叧閿唬鐮侊細(xì)


for(limit=0; ;limit++)
        
{
            
if(dfs(start,0))
            
{
                
if(limit == 0)
                
{
                    printf(
"No moves needed\n");
                }

                
else
                
{
                    
for(i=0; i<limit; i++)
                    
{
                        printf(
"%c",'A'+pre[i]);
                    }

                    printf(
"\n");
                }

                printf(
"%d\n",rlt);
                
break;
            }

        }

///榪唬榪囩▼
int dfs(struct S now, int depth)
{
    
int c1,c2,c3;
    struct S st;
    test(now,c1,c2,c3);
    
if(c1 == 8)
    
{
        rlt
=1;
        
return 1;
    }

    
else if(c2 == 8)
    
{
        rlt
=2;
        
return 1;
    }

    
else if(c3 == 8)
    
{
        rlt
=3;
        
return 1;
    }

    
if(depth == limit)
        
return 0;
    
if(8-c1 > limit-depth && 8-c2 > limit-depth && 8-c3 > limit-depth)
        
return 0;
    st
=NewStateA(now);
    pre[depth]
=0;
    
if(dfs(st,depth+1))
        
return 1;
    st
=NewStateB(now);
    pre[depth]
=1;
    
if(dfs(st,depth+1))
        
return 1;
    st
=NewStateC(now);
    pre[depth]
=2;
    
if(dfs(st,depth+1))
        
return 1;
    st
=NewStateD(now);
    pre[depth]
=3;
    
if(dfs(st,depth+1))
        
return 1;
    st
=NewStateE(now);
    pre[depth]
=4;
    
if(dfs(st,depth+1))
        
return 1;
    st
=NewStateF(now);
    pre[depth]
=5;
    
if(dfs(st,depth+1))
        
return 1;
    st
=NewStateG(now);
    pre[depth]
=6;
    
if(dfs(st,depth+1))
        
return 1;
    st
=NewStateH(now);
    pre[depth]
=7;
    
if(dfs(st,depth+1))
        
return 1;
    
return 0;
}

///娣辨悳


椋為 2008-04-20 15:44 鍙戣〃璇勮
]]>
A*鎼滅儲姹傛渶鐭礬http://www.shnenglu.com/linyangfei/archive/2008/04/20/47662.html椋為椋為Sun, 20 Apr 2008 07:25:00 GMThttp://www.shnenglu.com/linyangfei/archive/2008/04/20/47662.htmlhttp://www.shnenglu.com/linyangfei/comments/47662.htmlhttp://www.shnenglu.com/linyangfei/archive/2008/04/20/47662.html#Feedback4http://www.shnenglu.com/linyangfei/comments/commentRss/47662.htmlhttp://www.shnenglu.com/linyangfei/services/trackbacks/47662.html闃呰鍏ㄦ枃

椋為 2008-04-20 15:25 鍙戣〃璇勮
]]>
Sudokuhttp://www.shnenglu.com/linyangfei/archive/2007/09/23/32718.html椋為椋為Sun, 23 Sep 2007 07:29:00 GMThttp://www.shnenglu.com/linyangfei/archive/2007/09/23/32718.htmlhttp://www.shnenglu.com/linyangfei/comments/32718.htmlhttp://www.shnenglu.com/linyangfei/archive/2007/09/23/32718.html#Feedback0http://www.shnenglu.com/linyangfei/comments/commentRss/32718.htmlhttp://www.shnenglu.com/linyangfei/services/trackbacks/32718.html2676 Sudoku

 

Source from錛?/span> http://acm.pku.edu.cn/JudgeOnline/problem?id=2676

Sudoku涓枃鍚?#8220;鏁扮嫭”娓告垙錛屾父鎴忚鍒欐槸鍦ㄤ竴涓?/span>9×9鐨勬柟鏍間腑濉叆1錛?/span>9榪?/span>9涓暟瀛楋紝9×9鐨勫ぇ鏂規(guī)牸鍙堣鍒掑垎鎴愪簡9涓?/span>3×3鐨勫皬鏂規(guī)牸錛岃姹傚~鍏ョ殑榪?/span>1錛?/span>9榪?/span>9涓暟瀛椾腑錛屽湪姣忎竴琛岋紝姣忎竴鍒楀強(qiáng)姣忎竴涓皬鏂規(guī)牸涓兘涓嶈兘閲嶅鍑虹幇銆?/span>

鍦?/span>pku涓婏紝鎴戞毚鎼滅殑鏂規(guī)硶錛屽皢姣忎釜絀烘牸鐨勪綅緗嚑涓嬶紝鐒跺悗鐢?/span>dfs寰閲屽~鏁幫紝涓嶇鍚堟潯浠剁殑灝卞洖婧傛柟娉曞涓嬶細(xì)

Source

 

Problem: 2676 User: alpc60

Memory: 80K Time: 1171MS

Language: C++ Result: Accepted

 

Source

#include <stdio.h>

#include <string.h>

 

struct P

{

       int x,y,num;

}point[100];

int map[10][10],count;

bool mr[10][10],mc[10][10],mm[10][10];

 

int dfs(int n);

int find(int x, int y);

 

int main()

{

       int i,j,cases;

       //freopen("2676.txt","r",stdin);

       scanf("%d",&cases);

       while(cases--)

       {

              count=0;

              memset(mc,false,sizeof(mc));

              memset(mr,false,sizeof(mr));

              memset(mm,false,sizeof(mm));

              memset(map,0,sizeof(map));

              for(i=1; i<=9; i++)

                     for(j=1; j<=9; j++)

                     {

                            scanf("%1d",&map[i][j]);

                            if(map[i][j]==0)

                            {

                                   point[count].x=i;

                                   point[count].y=j;

                                   point[count].num=0;

                                   count++;

                            }

                            else

                            {

                                   mr[i][map[i][j]]=true;

                                   mc[j][map[i][j]]=true;

                                   mm[find(i,j)][map[i][j]]=true;

                            }

                     }

              dfs(0);

              //{

                     for(i=0; i<count; i++)

                            map[point[i].x][point[i].y]=point[i].num;

                     for(i=1; i<=9; i++)

                     {

                            for(j=1; j<=9; j++)

                            {

                                   printf("%d",map[i][j]);

                            }

                            printf("\n");

                     }

              //}

       }

       return 0;

}

int dfs(int n)

{

       int i,t;

       if(n>=count)

              return 1;

       t=find(point[n].x,point[n].y);

       for(i=1; i<=9; i++)

       {

              if(!mr[point[n].x][i] && !mc[point[n].y][i] && !mm[t][i])

              {

                     mr[point[n].x][i]=true;

                     mc[point[n].y][i]=true;

                     mm[t][i]=true;

                     point[n].num=i;

                     if(dfs(n+1))

                            return 1;

                     mr[point[n].x][i]=false;

                     mc[point[n].y][i]=false;

                     mm[t][i]=false;

                     point[n].num=0;

              }

       }

       return 0;

}

int find(int x, int y)

{

       int r,c;

       r=x%3?(x/3+1):(x/3);

       c=y%3?(y/3+1):(y/3);

       return (r-1)*3+c;

}



椋為 2007-09-23 15:29 鍙戣〃璇勮
]]>
緗戠粶嫻?/title><link>http://www.shnenglu.com/linyangfei/archive/2007/09/22/32675.html</link><dc:creator>椋為</dc:creator><author>椋為</author><pubDate>Sat, 22 Sep 2007 09:09:00 GMT</pubDate><guid>http://www.shnenglu.com/linyangfei/archive/2007/09/22/32675.html</guid><wfw:comment>http://www.shnenglu.com/linyangfei/comments/32675.html</wfw:comment><comments>http://www.shnenglu.com/linyangfei/archive/2007/09/22/32675.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/linyangfei/comments/commentRss/32675.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/linyangfei/services/trackbacks/32675.html</trackback:ping><description><![CDATA[  <p><span>緗戠粶嫻?/span></p> <p><span>1273 </span><span>Drainage Ditches</span></p> <p><span>榪欐槸涓閬撴瘮杈冨崟綰殑緗戠粶嫻侊紝棰樼洰瑕佹眰鍙姹傚嚭婧愮偣鍒版眹鐐圭殑鏈澶ф祦灝辮浜嗭紝鑰屽茍涓嶉渶瑕佷換浣曠殑寤烘ā鎶借薄鐨勪笢瑗匡紝鍞竴涓鐐硅娉ㄦ剰鐨勬槸錛岃鑰冭檻鏈夐噸杈圭殑鎯呭喌銆?/span></p> <p><span>榪欓噷鎴戠敤鐨勬槸澧炲箍璺硶姹傜殑鏈澶ф祦錛屾祦浠庢簮鐐?/span><span>s</span><span>鍑哄彂錛岀敤</span><span>BFS</span><span>鎵懼埌涓鏉″騫胯礬寰勶紝鐒跺悗鎵捐繖鏉¤礬寰勪笂鐨勬渶灝忓?/span><span>min</span><span>錛屽澧炲箍璺繘琛屾墿灞曪紝姣忎竴嬈℃墿灞曚細(xì)浣垮緱</span><span>f[pre[i]][i]</span><span>鐨勫煎澶э紝閭d箞瀹冪殑鍙嶅悜璺緞</span><span>f[i][pre[i]]</span><span>鐨勫間細(xì)鍑忓皬錛屼竴鐩磋繘琛屼笅鍘伙紝鐩村埌鎵句笉鍒板騫胯礬涓烘錛岀畻娉曠粨鏉熴?/span></p> <p><span>Source</span></p> <p> </p> <p><span>Problem Id:1273 User Id:linyangfei </span></p> <p><span>Memory:240K Time:15MS</span></p> <p><span>Language:C++ Result:Accepted</span></p> <p> </p> <p><span>Source </span></p> <p> </p> <p><span>#include <stdio.h></span></p> <p><span>#include <string.h></span></p> <p> </p> <p><span>int n,m,pre[205];</span></p> <p><span>int f[205][205];</span></p> <p><span>bool mark[205];</span></p> <p> </p> <p><span>int bfs();</span></p> <p><span>__int64 MaxFlow();</span></p> <p> </p> <p><span>int main()</span></p> <p><span>{</span></p> <p><span><span>       </span>int i,s,e,c;</span></p> <p><span><span>       </span>//freopen("1273.in","r",stdin);</span></p> <p><span><span>       </span>while(scanf("%d%d",&m,&n)!=EOF)</span></p> <p><span><span>       </span>{</span></p> <p><span><span>              </span>memset(f,0,sizeof(f));</span></p> <p><span><span>              </span>for(i=0; i<m; i++)</span></p> <p><span><span>              </span>{</span></p> <p><span><span>                     </span>scanf("%d%d%d",&s,&e,&c);</span></p> <p><span><span>                     </span>if(f[s-1][e-1]==0)</span></p> <p><span><span>                            </span>f[s-1][e-1]=c;</span></p> <p><span><span>                     </span>else</span></p> <p><span><span>                            </span>f[s-1][e-1]+=c;</span></p> <p><span><span>              </span>}</span></p> <p><span><span>              </span>printf("%I64d\n",MaxFlow());</span></p> <p><span><span>       </span>}</span></p> <p><span><span>       </span>return 0;</span></p> <p><span>}</span></p> <p> </p> <p><span>int bfs()</span></p> <p><span>{</span></p> <p><span><span>       </span>int q[205],qt=0,qh=1,i,x,min;</span></p> <p><span><span>       </span>q[qt]=0;</span></p> <p><span><span>       </span>mark[0]=true;</span></p> <p><span><span>       </span>while(qt<qh)</span></p> <p><span><span>       </span>{</span></p> <p><span><span>              </span>x=q[qt];</span></p> <p><span><span>              </span>if(x==n-1)</span></p> <p><span><span>              </span>{</span></p> <p><span><span>                     </span>min=100000000;</span></p> <p><span><span>                     </span>for(i=n-1; pre[i]!=-1; i=pre[i])</span></p> <p><span><span>                            </span>min=f[pre[i]][i]<min?f[pre[i]][i]:min;</span></p> <p><span><span>                     </span>return min;</span></p> <p><span><span>              </span>}</span></p> <p><span><span>              </span>for(i=1; i<n; i++)</span></p> <p><span><span>              </span>{</span></p> <p><span><span>                     </span>if(!mark[i] && f[x][i]>0)</span></p> <p><span><span>                     </span>{</span></p> <p><span><span>                            </span>q[qh++]=i;</span></p> <p><span><span>                            </span>mark[i]=true;</span></p> <p><span><span>                            </span>pre[i]=x;</span></p> <p><span><span>                     </span>}</span></p> <p><span><span>              </span>}</span></p> <p><span><span>              </span>qt++;</span></p> <p><span><span>       </span>}</span></p> <p><span><span>       </span>return 0;</span></p> <p><span>}</span></p> <p> </p> <p><span>__int64 MaxFlow()</span></p> <p><span>{</span></p> <p><span><span>       </span>int i,min;</span></p> <p><span><span>       </span>__int64 maxflow=0;</span></p> <p><span><span>       </span>memset(mark,0,sizeof(mark));</span></p> <p><span><span>       </span>for(i=0; i<n; i++)</span></p> <p><span><span>              </span>pre[i]=-1;</span></p> <p><span><span>       </span>while(min=bfs())</span></p> <p><span><span>       </span>{</span></p> <p><span><span>              </span>for(i=n-1; pre[i]!=-1; i=pre[i])</span></p> <p><span><span>              </span>{</span></p> <p><span><span>                     </span>f[pre[i]][i]-=min;</span></p> <p><span><span>                     </span>f[i][pre[i]]+=min;</span></p> <p><span><span>                     </span></span></p> <p><span><span>              </span>}</span></p> <p><span><span>              </span>maxflow+=min;</span></p> <p><span><span>              </span>memset(mark,0,sizeof(mark));</span></p> <p><span><span>              </span>for(i=0; i<n; i++)</span></p> <p><span><span>                     </span>pre[i]=-1;</span></p> <p><span><span>       </span>}</span></p> <p><span><span>       </span>return maxflow;<span>     </span></span></p> <p><span>}</span></p> <p><span>1149 PIGS</span></p> <p><span><span>       </span></span><span>涔熸槸涓閬撳緢緇忓吀鐨勭綉緇滄祦鐨勯鐩紝棰樼洰澶ф剰鏄?/span><span>Mirko</span><span>鏈?/span><span>M</span><span>涓尓鍦堬紝鐚湀閲岄潰鏈変竴瀹氭暟閲忕殑鐚紝浣嗕粬娌℃湁閽ュ寵錛岃屽彧鏈夋潵涔扮尓鐨勯【瀹㈡墠浼?xì)鏈変竴浜涚壒瀹氭埧闂寸殑閽ュ寵錛屾瘡嬈¢【瀹㈡潵涔嬪墠錛岄兘璺?/span><span>Mirko</span><span>棰勭害濂斤紝鎵浠?/span><span>Mirko</span><span>鐨勪換鍔″氨鏄壘鍑轟竴涓鍒掞紝浣夸粬鑳藉崠鍑烘渶澶氭暟閲忕殑鐚傚浜庢瘡浣嶉【瀹紝</span><span>Mirko</span><span>鍙互閫夋嫨鍗栧嚭鐚殑鏁伴噺錛屼篃鍙互鍦ㄨ欏懼鎵撳紑鐨勭尓鍦堥棿浠繪剰璋冩暣鐚殑鏁伴噺錛屾瘡涓尓鍦堢殑瀹歸噺鏃犻檺澶с?/span></p> <p><span><span>       </span></span><span>鎴戣寰楄繖涓棶棰樼殑涓涓叧閿偣鏄緩妯★紝濡備綍寤虹珛涓涓綉緇滄祦鐨勬ā鍨嬪緢鍏抽敭銆傛垜鎶婃墍鏈夌殑鐚湀緇熶竴鐪嬫垚涓涓ぇ鐨勬簮鐐?/span><span>S</span><span>錛屾妸姣忎釜欏懼鐪嬫垚鏄竴涓妭鐐癸紝鐒跺悗鍐嶄漢宸ュ湴娣誨姞涓涓眹鐐廣傝繖鏍峰彲浠ュ緱鍑轟笅闈㈢殑璺緞鍏崇郴銆?/span></p> <p><span><span>1銆?nbsp;</span></span><span>鍦ㄥ厛鍒扮殑欏懼鍜屽悗鍒扮殑欏懼涔嬮棿鏈変竴鏉¤礬寰勶紝鎸囧悜鍚庡埌鐨勯【瀹紝榪欐潯璺緞鐨勫閲忔棤闄愬ぇ銆?/span></p> <p><span><span>2銆?nbsp;</span></span><span>鍦ㄦ簮鐐規(guī)湁鎸囧悜鍚勪釜欏懼鐨勮礬寰勶紝璺緞鐨勫閲忎負(fù)欏懼鎷ユ湁鐨勯挜鍖欐墍鑳芥墦寮鐨勭尓鍦堢殑鐚殑鎬婚噺錛屾敞鎰忥紝褰撲袱涓【瀹㈡嫢鏈夊悓涓鎶婇挜鍖欑殑鏃跺欙紝鐚湀鐨勬暟閲忓彧鑳藉姞鍒頒竴涓【瀹㈣妭鐐圭殑璺緞涓婏紝涓嶈兘閲嶅鍔狅紝浠栦滑涔嬮棿鐨勮漿縐誨叧緋誨氨闈?/span><span>1</span><span>涓袱欏懼闂村閲忔棤闄愬ぇ鐨勮礬寰勬潵瀹炵幇銆?/span></p> <p><span>鎴戞兂鏈変簡榪欎袱鐐癸紝鎶婄綉緇滄祦鐨勬ā鍨嬪緩绔嬭搗鏉ュ悗錛屾眰瑙g殑綆楁硶鎸夌収</span><span>1273</span><span>鐨勬ā鐗堝氨搴旇寰堝鏄撲簡銆?/span></p> <p><span>#include <stdio.h></span></p> <p><span>#include <string.h></span></p> <p> </p> <p><span>const int INF=100000000;</span></p> <p> </p> <p><span>int f[105][105],pig[1005],key[1005][105],pre[105];</span></p> <p><span>bool mark[105];</span></p> <p><span>int m,n;</span></p> <p> </p> <p><span>int bfs();</span></p> <p><span>int MaxFlow();</span></p> <p> </p> <p><span>int main()</span></p> <p><span>{</span></p> <p><span><span>       </span>int i,j,c,p,k;</span></p> <p><span><span>       </span>//</span><span>灝嗙尓鍦堢湅浣滀竴涓ぇ鐨勬簮鐐?/span><span>0</span><span>錛屽啀澶栧姞涓涓眹鐐?/span><span>n+1</span></p> <p><span><span>       </span>freopen("1149.txt","r",stdin);</span></p> <p><span><span>       </span>while(scanf("%d%d",&m,&n)!=EOF)</span></p> <p><span><span>       </span>{</span></p> <p><span><span>              </span>for(i=1; i<=m; i++)</span></p> <p><span><span>                     </span>scanf("%d",&pig[i]);</span></p> <p><span><span>              </span>memset(f,0,sizeof(f));</span></p> <p><span><span>              </span>memset(key,0,sizeof(key));</span></p> <p><span><span>              </span>for(i=1; i<=n; i++)</span></p> <p><span><span>              </span>{</span></p> <p><span><span>                     </span>scanf("%d",&c);<span>                         </span>//</span><span>姣忎綅欏懼鎷ユ湁閽ュ寵鐨勬暟閲?/span></p> <p><span><span>                     </span>for(j=1; j<=c; j++)</span></p> <p><span><span>                     </span>{</span></p> <p><span><span>                            </span>scanf("%d",&p);<span>                  </span>//</span><span>杈撳叆姣忔妸閽ュ寵鐨勭紪鍙?/span></p> <p><span><span>                            </span>f[0][i]+=pig[p];</span></p> <p><span><span>                            </span>key[p][i]=1;</span></p> <p><span><span>                            </span>pig[p]=0;</span></p> <p><span><span>                     </span>}</span></p> <p><span><span>                     </span>scanf("%d",&c);<span>                         </span>//</span><span>杈撳叆姣忎綅欏懼闇瑕佺尓鐨勬暟閲?/span></p> <p><span><span>              </span><span>       </span>f[i][n+1]=c;</span></p> <p><span><span>              </span>}</span></p> <p><span><span>              </span>for(i=1; i<=m; i++)</span></p> <p><span><span>                     </span>for(j=1; j<=n; j++)</span></p> <p><span><span>                     </span>{</span></p> <p><span><span>                            </span>if(key[i][j])</span></p> <p><span><span>                                   </span>for(k=j+1; k<=n; k++)</span></p> <p><span><span>                                   </span>{</span></p> <p><span><span>                                          </span>if(key[i][k])</span></p> <p><span><span>                                                 </span>f[j][k]=INF;</span></p> <p><span><span>                                   </span>}</span></p> <p><span><span>                     </span>}</span></p> <p><span><span>              </span>printf("%d\n",MaxFlow());</span></p> <p><span><span>       </span>}</span></p> <p><span><span>       </span>return 0;</span></p> <p><span>}</span></p> <p><span>int bfs()</span></p> <p><span>{</span></p> <p><span><span>       </span>int q[205],qt=0,qh=1,i,x,min;</span></p> <p><span><span>       </span>q[qt]=0;</span></p> <p><span><span>       </span>mark[0]=true;</span></p> <p><span><span>       </span>while(qt<qh)</span></p> <p><span><span>       </span>{</span></p> <p><span><span>              </span>x=q[qt];</span></p> <p><span><span>              </span>if(x==n+1)</span></p> <p><span><span>              </span>{</span></p> <p><span><span>                     </span>min=100000000;</span></p> <p><span><span>                     </span>for(i=n+1; pre[i]!=-1; i=pre[i])</span></p> <p><span><span>                            </span>min=f[pre[i]][i]<min?f[pre[i]][i]:min;</span></p> <p><span><span>                     </span>return min;</span></p> <p><span><span>              </span>}</span></p> <p><span><span>              </span>for(i=1; i<=n+1; i++)</span></p> <p><span><span>              </span>{</span></p> <p><span><span>                     </span>if(!mark[i] && f[x][i]>0)</span></p> <p><span><span>                     </span>{</span></p> <p><span><span>                            </span>q[qh++]=i;</span></p> <p><span><span>                            </span>mark[i]=true;</span></p> <p><span><span>                            </span>pre[i]=x;</span></p> <p><span><span>                     </span>}</span></p> <p><span><span>              </span>}</span></p> <p><span><span>              </span>qt++;</span></p> <p><span><span>       </span>}</span></p> <p><span><span>       </span>return 0;</span></p> <p><span>}</span></p> <p> </p> <p><span>int MaxFlow()</span></p> <p><span>{</span></p> <p><span><span>       </span>int i,min;</span></p> <p><span><span>       </span>int maxflow=0;</span></p> <p><span><span>       </span>memset(mark,0,sizeof(mark));</span></p> <p><span><span>       </span>for(i=0; i<=n+1; i++)</span></p> <p><span><span>              </span>pre[i]=-1;</span></p> <p><span><span>       </span>while(min=bfs())</span></p> <p><span><span>       </span>{</span></p> <p><span><span>              </span>for(i=n+1; pre[i]!=-1; i=pre[i])</span></p> <p><span><span>              </span>{</span></p> <p><span><span>                     </span>f[pre[i]][i]-=min;</span></p> <p><span><span>                     </span>f[i][pre[i]]+=min;</span></p> <p><span><span>                     </span></span></p> <p><span><span>              </span>}</span></p> <p><span><span>              </span>maxflow+=min;</span></p> <p><span><span>              </span>memset(mark,0,sizeof(mark));</span></p> <p><span><span>              </span>for(i=0; i<=n+1; i++)</span></p> <p><span><span>                     </span>pre[i]=-1;</span></p> <p><span><span>       </span>}</span></p> <p><span><span>       </span>return maxflow;<span>     </span></span></p> <p><span>}</span></p> <p> </p> <img src ="http://www.shnenglu.com/linyangfei/aggbug/32675.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/linyangfei/" target="_blank">椋為</a> 2007-09-22 17:09 <a href="http://www.shnenglu.com/linyangfei/archive/2007/09/22/32675.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍔ㄦ佽鍒掍笓棰?/title><link>http://www.shnenglu.com/linyangfei/archive/2007/09/22/32674.html</link><dc:creator>椋為</dc:creator><author>椋為</author><pubDate>Sat, 22 Sep 2007 09:06:00 GMT</pubDate><guid>http://www.shnenglu.com/linyangfei/archive/2007/09/22/32674.html</guid><wfw:comment>http://www.shnenglu.com/linyangfei/comments/32674.html</wfw:comment><comments>http://www.shnenglu.com/linyangfei/archive/2007/09/22/32674.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.shnenglu.com/linyangfei/comments/commentRss/32674.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/linyangfei/services/trackbacks/32674.html</trackback:ping><description><![CDATA[  <p><span>涓銆?/span><span>1050 To the Max</span><span>錛?/span></p> <p><span><span>       </span></span><span>榪欐槸鎴戠殑絎竴涓?/span><span>DP</span><span>錛岄鐩殑鎰忔濆緢綆鍗曪紝鍦ㄤ竴涓煩闃甸噷闈㈡壘瀹冪殑瀛愮煩闃碉紝浣垮緱瀛愮煩闃墊暟鍊間箣鍜屽埌杈炬渶澶с傚叾瀹炲氨鏄渶澶у瓙孌靛拰闂鍦ㄤ簩緇寸┖闂翠笂鐨勬帹騫褲傚厛璇翠竴涓嬩竴緇寸殑鎯呭喌鍚с傝鏈夋暟緇?/span><span>a0,a1…an,</span><span>鎵鵑櫎鍏朵腑榪炵畫鐨勫瓙孌碉紝浣垮畠浠殑鍜岃揪鍒版渶澶с傛渶寮濮嬬殑鎯蟲硶錛屾槸鏋氫婦鐭╅樀鐨勯暱搴︼紝璁$畻姣忎釜瀛愮煩闃電殑鍜岋紝鐒跺悗姣旇緝寰楀嚭鏈澶у鹼紝榪欐牱瑕佹秷鑰楃殑鏃墮棿涓?/span><span>O(n)</span><span>銆傝鎴戜滑鍐嶆兂鎯籌紝濡傛灉榪欎釜搴忓垪鐨勬瘡涓涓暟閮芥槸鏁存暟錛岄偅涔堝畠浠殑鏈澶у瓙孌靛拰灝辨槸鎶婃墍鏈夌殑鏁扮浉鍔犮傛墍浠ユ垜浠兂瑕佸敖鍙兘澶氬湴鎵懼埌姝f暟鐩稿姞銆傚湪搴忓垪涓湁璐熸暟鐨勬儏鍐典笅錛屼粠澶村紑濮嬫壂鎻忔暟緇勶紝鎶婃鏁伴兘鐩稿姞錛岃繖鍏朵腑鍙兘浼?xì)鏈夎礋鏁板Q屼竴縐嶆儏鍐墊槸錛氳礋鏁板拰鍑忓皬瀛愭鍜岋紝浣嗚繖鏃跺瓙孌靛拰浠嶇劧涓烘錛岀敤</span><span>sum</span><span>璁板綍涓嬭繛緇瓙孌靛拰鐨勬渶澶у鹼紝緇х畫鎯沖悗鎵弿錛屽洜涓哄悗闈㈡湁鍙兘鍑虹幇鏇村ぇ鐨勬鏁扮殑鎯呭喌錛屼細(xì)浣垮拰姣斿師鏉ユ病鍔犺礋鏁頒箣鍓嶆洿澶э紱絎簩縐嶆儏鍐墊槸錛氬姞鍏ヤ竴涓礋鏁板悗錛屾槸榪欎釜榪炵畫鐨勫瓙孌靛拰鐨勫煎彉鎴愪簡璐熸暟錛岃繖鏃跺氨瑕佹姏寮冭璐熸暟浠ュ強(qiáng)璇ヨ礋鏁頒箣鍓嶇殑鎵鏈夊簭鍒楋紝鍥犱負(fù)鍓嶉潰鑻ユ湁瀛愭涓庡悗闈㈡瀯鎴愪簡榪炵畫鐨勫瓙孌碉紝鍒欒繖涓瓙孌典竴瀹氫細(xì)鍖呮嫭榪欎釜璐熸暟錛岃屽湪榪欎釜璐熸暟涔嬪墠鐨勫簭鍒楃殑鍜屾槸涓礋鏁幫紝閭d箞榪欎釜瀛愭鐨勫拰涓瀹氫笉鏄渶澶х殑瀛愭鍜屻傛姏寮冭繖涓礋鏁頒箣鍓嶇殑搴忓垪鍚庯紝瀛愭鍜屼粠榪欎釜璐熸暟鍚庨潰鐨勭涓涓暟綆楄搗錛岀戶緇壂鎻忋?/span></p> <p><span>//</span><span>涓緇存暟緇勬眰鏈澶у瓧孌?/span></p> <p><span>int submax1(int a[], int n)</span></p> <p><span>{</span></p> <p><span><span>       </span>int b=0;</span></p> <p><span><span>       </span>int bn=-32767;</span></p> <p><span><span>       </span>int i;</span></p> <p><span><span>       </span>int sum=0;</span></p> <p><span><span>       </span>for(i=0; i<n; i++)</span></p> <p><span><span>       </span>{</span></p> <p><span><span>              </span>if(b>0)</span></p> <p><span><span>              </span>{</span></p> <p><span><span>                     </span>b+=a[i];</span></p> <p><span><span>              </span>}</span></p> <p><span><span>              </span>else if(a[i]>bn && a[i]<0)</span></p> <p><span><span>              </span>{</span></p> <p><span><span>                     </span>bn=a[i];</span></p> <p><span><span>                     </span>b=a[i];</span></p> <p><span><span>              </span>}</span></p> <p><span><span>              </span>else</span></p> <p><span><span>              </span>{</span></p> <p><span><span>                     </span>b=a[i];</span></p> <p><span><span>              </span>}</span></p> <p><span><span>              </span>if(b>sum)</span></p> <p><span><span>              </span>{</span></p> <p><span><span>                     </span>sum=b;</span></p> <p><span><span>              </span>}</span></p> <p><span><span>       </span>}</span></p> <p><span><span>       </span>if(sum==0)</span></p> <p><span><span>              </span>return bn;</span></p> <p><span><span>       </span>else</span></p> <p><span><span>              </span>return sum;</span></p> <p><span>}</span></p> <p><span>鍏朵腑鍙橀噺</span><span>b</span><span>灝辨槸璁板綍褰撳墠鎵弿榪囩殑瀛愭鍜岀殑錛岃?/span><span>sum</span><span>璁板綍鐨勬槸瀛愭鍜岀殑鏈澶у?/span></p> <p><span>浜岀淮鐨勬儏鍐碉細(xì)</span></p> <p><span><span>       </span></span><span>榪欓噷鎴戜嬌鐢ㄤ簡涓涓緢綆鍗曠殑鍋氭硶錛屽湪浜岀淮鏁扮粍</span><span>a[i][j]</span><span>閲岄潰鏋氫婦絎竴緇寸殑闀垮害</span><span>k</span><span>錛岀劧鍚庡緱鍒頒竴涓?/span><span>k*n</span><span>鐨勫瓙鐭╅樀錛屾妸榪欎釜瀛愮煩闃電殑姣忎竴鍒楁暟鍊肩浉鍔狅紝灝辨妸榪欎釜浜岀淮鏁扮粍杞寲鎴愪簡涓緇達(dá)紝鍐嶈皟鐢ㄥ嚱鏁?/span><span>int submax1(int a[], int n)</span><span>錛屽氨璁$畻寰楀嚭鏈澶у箋?/span></p> <p><span>鎬葷粨錛氭劅瑙夋垜鍋氳繖閬撻鐩繕涓嶆槸寰堝儚</span><span>DP</span><span>錛屽彧鏈夊湪姹備竴緇存儏鍐典笅鐨?/span><span>sum</span><span>璁板綍鏈澶у鹼紝浠ュ強(qiáng)鍦ㄦ壂鎻忔槸璁$畻鐨勫瓙孌靛拰</span><span>b</span><span>錛屼唬琛ㄤ簡鏌愭暟鍓嶉潰榪炵畫鐨勬渶澶у瓙孌靛拰銆?/span></p> <p><span>浜屻?/span><span>1579 Function Run Fun</span></p> <p><span>榪欒偗瀹氭槸涓涓蹇冪Н铏戠殑鍑芥暟錛屾病鐪嬪嚭瀹冩湁浠涔堝疄闄呯殑鐢ㄥ</span></p> <p><span>Consider a three-parameter recursive function w(a, b, c): <br>if a <= 0 or b <= 0 or c <= 0, then w(a, b, c) returns: 1 <br>if a > 20 or b > 20 or c > 20, then w(a, b, c) returns: w(20, 20, 20) <br>if a < b and b < c, then w(a, b, c) returns: w(a, b, c-1) + w(a, b-1, c-1) - w(a, b-1, c) <br>otherwise it returns: w(a-1, b, c) + w(a-1, b-1, c) + w(a-1, b, c-1) - w(a-1, b-1, c-1)</span></p> <p><span>榪欐湰韜氨鏄竴涓掑綊鍑芥暟錛岃鏄寜鐓у嚱鏁版湰韜啓閫掑綊寮忥紝緇撴灉鑲畾鏄?/span><span>TLE</span><span>錛岃繖閲屾垜寮浜嗕竴涓笁緇存暟緇勶紝浠?/span><span>w(0,0,0)</span><span>寮濮嬮掓帹錛岄愭浜х敓鍒?/span><span>w(20,20,20)</span><span>鐨勫鹼紝澶嶆潅搴?/span><span>O(n^3)</span></p> <p><span>鎬葷粨錛氳繖閬撻鏄緢鍦伴亾鐨?/span><span>DP</span><span>錛屽洜涓哄畠鐨勫瓙闂瀹炲湪鏄お澶氫簡錛屼絾榪樻槸灞炰簬綆鍗曢鐩殑鑼冪暣錛屽氨鍍忔妸</span><span>fabonacci</span><span>鍑芥暟澧炲姞鍒頒笁緇達(dá)紝闄愬埗鏉′歡澶氱偣鑰屽凡錛岃屽疄闄呬笂鐨勫仛娉曢兘涓鏍楓?/span></p> <p><span>涓夈?/span><span>1080 Humman Gene Function</span></p> <p><span>搴旇璇磋繖鏄竴閬撴瘮杈冪粡鍏哥殑</span><span>DP</span><span>錛屼袱涓插熀鍥犲簭鍒楀寘鍚?/span><span>A</span><span>銆?/span><span>C</span><span>銆?/span><span>G</span><span>銆?/span><span>T</span><span>錛屾瘡涓や釜瀛楁瘝闂寸殑鍖歸厤閮戒細(xì)浜х敓涓涓浉浼煎鹼紝姹傚熀鍥犲簭鍒楋紙瀛楃涓詫級鍖歸厤鐨勬渶澶у箋?/span></p> <p><span>鎰熻榪欓鏈夌偣鍍忔眰鏈闀垮叕鍏卞瓙搴忓垪銆傚彧涓嶈繃鎶婃眰鏈澶ч暱搴︽敼鎴愪簡姹傛渶澶х殑鍖歸厤鍊箋傜敤浜岀淮鏁扮粍</span><span>m[i][j]</span><span>璁板綍瀛楃涓?/span><span>a</span><span>涓殑絎?/span><span>i</span><span>涓瓧絎︿笌瀛楃涓?/span><span>b</span><span>涓殑絎?/span><span>j</span><span>涓瓧絎﹀尮閰嶆墍浜х敓鐨勬渶澶у箋傝嫢瀛楃涓?/span><span>a</span><span>鐨勯暱搴︿負(fù)</span><span>la</span><span>錛屽瓧絎︿覆</span><span>b</span><span>鐨勯暱搴︿負(fù)</span><span>lb</span><span>錛屽垵濮嬫椂</span><span>m[la][k](0<=k<=lb-1),</span><span>榪欓噷鍗充負(fù)瀛楃涓?/span><span>a</span><span>鐨勬湯灝句笌</span><span>b</span><span>涓殑瀛楃鍖歸厤錛屽洜涓鴻秴榪囦簡瀛楃涓?/span><span>a</span><span>鐨勯暱搴︼紝鎵浠ュ尮閰嶇殑鏃跺欏彧鑳芥椂浠ョ┖鏍?/span><span>’-’</span><span>鍖歸厤銆傚悓鐞嗗彲浜х敓</span><span>m[k][lb](0<=k<=la-1)</span><span>錛岀殑鎵鏈夊鹼紝鍐嶄互姝ゅ線鍓嶉掓帹錛屽叾鐘舵佽漿縐繪柟紼嬩負(fù)</span></p> <p><span>m[i][j]=max{map[i][j]+m[i+1][j+1],m[‘-‘][j]+m[i][j+1],m[i][‘-’]+m[i+1][j]}</span></p> <p><span>鎵浠ユ渶鍚?/span><span>m[0][0]</span><span>鍗充負(fù)鎵姹傘?/span></p> <p><span>鍥涖?/span><span>2533 Longest Ordered Subsequence</span></p> <p><span><span>       </span></span><span>寰堟棭浠ュ墠灝辯湅榪囪繖棰橈紝姹傛渶澶ч掑搴忓垪錛岄偅鏃跺垰鍒氭檽寰椾粈涔堝彨“鍔ㄦ佽鍒?#8221;錛屾槸銆婄畻娉曡璁′笌鍒嗘瀽銆嬶紙鐜嬫檽涓滐級涓婄殑涓閬撲範(fàn)棰橈紝寮濮嬩笉浼?xì)鍋氥傚悗鏉ユ兂浜嗕竴縐嶅緢絎ㄧ殑鍔炴硶錛岀敤浜?/span><span>O(n^2)</span><span>鐨勬椂闂達(dá)紝榪橀檮鍔犱簡</span><span>n^2</span><span>鐨勭┖闂淬傜湅浜嗕笘閾殑涓ょ鏂規(guī)硶錛屼竴縐嶆槸</span><span>O(n^2),</span><span>涓縐嶆槸</span><span>O(nlogn)</span><span>銆備袱縐嶆柟娉曟牳蹇冪殑鏂規(guī)硶閮戒竴鏍鳳紝鐢ㄤ竴涓?/span><span>n</span><span>澶у皬鐨勪竴緇寸┖闂?/span><span>(a[n])</span><span>錛?/span><span>a[i]</span><span>琛ㄧず瀛愪覆闀垮害涓?/span><span>i</span><span>鏃舵墍鏈夊瓙涓叉渶澶у間腑鐨勬渶灝忓鹼紝鍥犱負(fù)瑕佹壘涓涓?/span><span>i</span><span>闀垮害鐨勫瓙涓詫紝閭d箞</span><span>a[i]</span><span>鐨勫艱嚦灝戣姣旈暱搴︿負(fù)</span><span>i-1</span><span>瀛愪覆涓殑涓涓渶鏈綅鐨勫艱澶с備箣鎵浠ヤ細(xì)鏈変袱縐嶆椂闂村鏉傚害鐨勫樊鍒紝灝辨槸鍦ㄦ煡鎵?/span><span>i-1</span><span>闀垮害鐨勬湯灝懼間腑鐨勬渶灝忓肩殑鏃跺欙紝鍓嶈呮槸綰挎х殑鎼滅儲錛屽悗鑰呮槸鐢ㄧ殑浜屽垎鎼滅儲錛屾彁楂樹簡鏃墮棿鏁堢巼銆傚彟澶栬涓涓嬭繖棰樼殑鍙樺艦鍚э紝</span><span>1631 Briging signals</span><span>錛屾槸鏈夊緢澶氳礬鐢卞櫒鎼嚎錛岃姹傛眰鍑轟簰涓嶇浉浜ょ殑鎼厤鐨勬渶澶т釜鏁般傜粏緇嗗垎鏋愪竴涓嬮鐩紝鍙琚尮閰嶇殑璺敱鍣ㄥ簭鍙鋒槸涓涓掑鐨勫簭鍒楋紝鍒欎粬浠殑榪炵嚎灝變笉浼?xì)鐩镐氦锛尀鎶姌q欓杞寲涓烘眰鏈澶ч掑搴忓垪鐨勯棶棰樸備絾闇瑕佹敞鎰忕殑鏄繖棰樼殑闂瑙勬ā</span><span>n</span><span>杈懼埌浜?/span><span>40000</span><span>錛?/span><span>Time Limit :1000MS</span><span>錛屾墍浠ュ湪榪欓噷瑕侀夌敤鍒氭墠鎻愬埌鐨?/span><span>O(nlogn)</span><span>鐨勭畻娉曪紝鎵嶄笉浼?xì)瀵艰?/span><span>TLE</span><span>銆?/span></p> <p><span>浜斻?/span><span>1014 Dividing</span></p> <p><span><span>       </span></span><span>瀹為檯涓婃棭灝辯湅鍒拌繖棰樹簡錛岄偅鏃跺</span><span>ACM</span><span>鐨勮璇嗚繕寰堝辜紼氾紝鍒氬瀹岀▼搴忚璁★紝瀛︿細(xì)鎬庝箞鐢ㄩ掑綊錛屼篃涓嶇湅棰樼洰鐨勬潯浠訛紝鍙嶆灝辨槸鍏</span><span>marble</span><span>錛屽啓浜嗕釜閫掑綊鐨勭▼搴忥紝嫻嬭瘯鏁版嵁褰撶劧鑳介氳繃錛屼絾鍏剁粨鏋滆偗瀹氭槸</span><span>TLE</span><span>浜嗐傚張榪囦簡涓孌墊椂闂達(dá)紝鏈変簡鐐規(guī)椂闂存晥鐜囩殑瑙傚康錛屽啓浜嗕釜鏋氫婦娉曡綆楁誨拰鐨?/span><span>1/2</span><span>鐨勫彲杈炬э紝涓嶈繃榪樻槸鏈夊緢澶氭儏鍐墊垜閮芥病鏈夎冭檻鍒幫紝緇撴灉</span><span>WA</span><span>浜嗐傚埌鐜板湪瀛?/span><span>DP</span><span>錛屽啀鏉ョ湅鎯蟲兂榪欓錛屽叾瀹炶繕鏈夋洿濂界殑瑙f硶銆備篃鏄綆楁誨拰鐨?/span><span>1/2(sum)</span><span>鐨勫彲杈炬э紝濡傛灉</span><span>marble</span><span>鐨勬繪暟鏄?/span><span>n</span><span>錛屽垯</span><span>DP</span><span>綆楁硶鐨勬椂闂村鏉傚害鍙互杈懼埌</span><span>O(n*sum)</span><span>銆傜敤涓涓竴緇存暟緇勬爣璁頒粠</span><span>0</span><span>錛?/span><span>sum</span><span>鎵鏈夊姞鍜岀殑鍙揪鎬э紝瀵逛簬涓棰楀疂鐭崇殑浠峰?/span><span>i</span><span>錛屾暟緇?/span><span>a[j]==true</span><span>錛岃〃紺哄拰涓?/span><span>j</span><span>鍙揪錛岄偅涔堝彲寰楀嚭</span></p> <p><span>a[i+j]=true,</span><span>鍗?/span><span>i+j</span><span>鐨勫煎彲杈俱傚驚鐜互鑷翠簬鐢ㄥ畬鎵鏈夌殑瀹濈煶錛岃瀵?/span><span>a[sum]</span><span>鐨勫鹼紝</span><span>true</span><span>鍗充負(fù)榪欎簺瀹濈煶鍙垎錛屽弽涔嬩笉鍙垎銆?/span></p> <p><span><span>       </span></span><span>鍏?/span><span>2192 Zipper</span></p> <p><span><span>       </span></span><span>鍙堟槸涓閬撳瓧絎︿覆鐨勫姩鎬佽鍒掗鐩紝綆榪頒竴涓嬶細(xì)緇欏嚭涓変釜瀛楃涓詫紝</span><span>s1,s2,s3</span><span>錛?/span><span>s3</span><span>鐨勯暱搴︿負(fù)</span><span>s1</span><span>涓?/span><span>s2</span><span>闀垮害涔嬪拰錛屽垽鏂?/span><span>s1</span><span>錛?/span><span>s2</span><span>鏄惁涓?/span><span>s3</span><span>鐨勪笉閲嶅悎鐨勫叕鍏卞瓙搴忓垪銆傚叾瀹炲氨鏄垽鍒叕鍏變箣搴忓垪鐨勫崌綰х増錛屾妸鍘熸潵鐨勪竴瀵逛竴錛屾敼鎴愪簡涓瀵逛簩銆傛垜鐢ㄤ竴涓簩緇存暟緇?/span><span>mark[i][j]</span><span>璁板綍</span><span>s1</span><span>涓殑絎?/span><span>i</span><span>涓瓧絎︿互鍙?/span><span>s2</span><span>涓殑絎?/span><span>j</span><span>涓瓧絎﹁兘鍚︿笌</span><span>s3[i+j]</span><span>鎯沖尮閰嶃?/span></p> <p><span><span>       </span>If(s1[i]==s3[i+j]) mark[i+1][j]=true;//s1</span><span>涓殑絎?/span><span>i</span><span>涓瓧絎﹀尮閰嶏紝鍒?/span><span>s1</span><span>涓插悜鍚庣Щ涓涓瓧絎?/span></p> <p><span><span>       </span>If(s2[j]==s3[i+j]) mark[i][j+1]=true;//s2</span><span>涓殑絎?/span><span>j</span><span>涓瓧絎﹀尮閰嶏紝鍒?/span><span>s2</span><span>涓插悜鍚庣Щ涓涓瓧絎?/span></p> <p><span>榪欐牱鐢?/span><span>O(n^2)</span><span>鐨勬椂闂達(dá)紝閫掓帹鑳戒駭鐢?/span><span>mark[c1][c2]</span><span>鐨勫鹼紝鍊間負(fù)</span><span>true</span><span>杈撳嚭鍗寵兘澶熷叏閮ㄥ尮閰嶃?/span></p> <p><span><span>       </span></span><span>涓冦?/span><span>2576 Tug of War</span></p> <p><span><span>       </span></span><span>鎴戣寰楅潪甯告湁蹇呰鍋氱殑涓閬撻鐩傝繖閬撻鐩湅浼煎緢綆鍗曪紝瀹炶川灝辨槸</span><span>n</span><span>涓暟錛屽皢鍏跺垎鎴愪袱鍫嗭紝涓ゅ爢鏁伴噺鐨勫樊璺濅笉瓚呰繃</span><span>1</span><span>錛屽茍涓斾嬌榪欎袱鍫嗘暟瀛椾箣鍜屾渶鎺ヨ繎銆傛槸涓閬撳姩鎬佽鍒掗鐩紝鐪嬭搗鏉ョ畝鍗曟槸鍥犱負(fù)鍙椾簡</span><span>1014</span><span>棰樼殑褰卞搷錛屼絾榪欓涓ゅ爢鐨勬暟鐩槸紜畾鐨勶紝涓鍫嗘槸</span><span>n/2</span><span>涓紝鍙︿竴鍫嗗垯鏄?/span><span>n-n/2</span><span>涓?/span><span>,</span><span>鑰?/span><span>1014</span><span>棰樻槸涓嶅彈鍔犲拰鏁扮洰鐨勫獎鍝嶇殑銆傝繖棰樹篃涓嶅悓涓庡綾沖嫆楠ㄧ墝閭i錛屽洜涓洪偅棰樹腑鍚勪釜鏁板瓧涔嬮棿鏄竴涓瀵瑰簲鐨勩傝嫤鎯充簡涓澶╂病鏈夌粨鏋滐紝鐪嬫潵榪欓榪樿瀵繪眰鍏跺畠鐨勬柟娉曘傝繖棰樹笉鏄垜鑷繁鎯抽櫎鏉ョ殑錛岀湅浜?/span><span>alpc02</span><span>鐨勪唬鐮侊紝鑷繁鍙堢収鑷繁鐨勭悊瑙i噸鍐欎簡涓閬嶃?/span></p> <p><span><span>       </span></span><span>璁板綍鐘舵佹槸鐢ㄤ竴涓簩緇存暟緇勶紝</span><span>mark[i][j]</span><span>琛ㄧず</span><span>i</span><span>涓暟鐩稿姞錛屽叾鍊艱兘鍚﹁揪鍒?/span><span>j</span><span>錛屽鏋滆兘</span><span>mark[i][j]</span><span>鐨勪負(fù)</span><span>true</span><span>銆傚浜庝竴涓緭鍏ョ殑鏁?/span><span>w</span><span>錛屼慨鏀?/span><span>i</span><span>涓暟鐨勬瘡涓縐嶇姸鎬侊紝鍏剁姸鎬佽漿縐繪柟紼嬶細(xì)</span></p> <p><span><span>       </span>If(m[i][j]) then m[i][j+w]=true;//j+w</span><span>鐨勫煎彲鐢?/span><span>j</span><span>鐨勫煎姞寰?/span></p> <p><span>鐢卞悗寰鍓嶄慨鏀規(guī)瘡涓涓?/span><span>i</span><span>涓嬬殑鍙揪鍊箋傞偅涔堟渶鍚庡氨鍙鍐?/span><span>n/2</span><span>琛屼腑鎵懼嚭</span><span>m[n/2][j]</span><span>鐨勬渶澶у鹼紙</span><span>j<=total/2</span><span>錛夛紝榪欏氨鏄袱鍫嗕箣鍜屾渶鎺ヨ繎鐨勪竴緇勬暟鍊箋?/span></p> <p><span><span>       </span></span><span>鍏?/span><span>2441 Arrange the Bulls</span></p> <p><span><span>       </span></span><span>榪欓閲屾垜鐪嬪埌浜嗗姩鎬佽鍒掔殑涓縐嶆柊鐨勬柟娉曘傛瘡澶寸墰鏈夎嚜宸卞枩嬈㈢殑綃悆鍦猴紝鎴戜滑鐨勪換鍔″氨鏄畨鎺掕繖浜涚墰鍒板畠浠枩嬈㈢殑綃悆鍦哄幓錛岀劧鍚庤綆楁墍鏈夊悎鐞嗙殑瑙g殑鏁伴噺錛堢鐞冨満鐨勬暟鐩渶澶?/span><span>20</span><span>涓級銆傛樉鐒訛紝瑕佹壘鍒頒竴涓В錛屽緢瀹規(guī)槗灝辮兘鎼滃嚭錛屼絾鏄姹傛墍鏈夎В鐨勬暟閲忥紝濡傛灉鍐嶇敤鎼滅儲鐨勬柟娉曪紝鍦ㄦ椂闂翠笂鏄笉鍫繊鍙楃殑銆傝繖閲岀敤浜嗕竴縐嶆柊鐨勬柟娉曪紙瀵逛簬鎴戞潵璇存槸涓縐嶆柊鏂規(guī)硶</span><span>^_^</span><span>錛夈傜敤浜岃繘鍒舵暟璁板綍褰撳墠綃悆鍦轟嬌鐢ㄧ殑鐘舵侊紝“</span><st1:chmetcnv TCSC="0" NumberType="1" Negative="False" HasSpace="False" SourceValue="1" UnitName="”" w:st="on"><span>1</span><span>”</span></st1:chmetcnv><span>琛ㄧず鏈垎閰嶏紝“</span><st1:chmetcnv TCSC="0" NumberType="1" Negative="False" HasSpace="False" SourceValue="0" UnitName="”" w:st="on"><span>0</span><span>”</span></st1:chmetcnv><span>琛ㄧず宸插垎閰嶏紝姣忎釜綃悆鍦轟笌姣忎釜鏁頒綅鐩稿搴斻傛墍浠?/span><span>20</span><span>涓鐞冨満灝辨誨叡闇瑕佷竴涓?/span><span>1<<20</span><span>鐨勬暟緇勬潵璁板綍鎵鏈夌敓鎴愮殑鐘舵併傛兂鍒拌繖閲岋紝鎴戣寰楄繖棰樺熀鏈笂宸茬粡瑙e喅涓鍗婁簡錛屽墿涓嬬殑灝辨槸濡備綍榪涜鐘舵佽漿縐伙紝鐢ㄧ殑灝辨槸浜岃繘鍒惰繍綆椼傛垜瑙夊緱鎴戝湪榪欎釜鏂歸潰涓鐐歸兘涓嶇啛鎮(zhèn)夛紝涓嶄細(xì)鍐欙紝鐪嬩簡鍒漢鐨勪唬鐮侊紝鐒跺悗鑷繁浠垮啓浜嗐?/span></p> <p><span>涓縐嶆槸鐢ㄦ粴鍔ㄦ暟緇勶紝榪欑鏂規(guī)硶鍗犵敤鏃墮棿絀洪棿閮借緝澶э紝鍙︿竴縐嶆槸鐘舵佸帇緙╃殑</span><span>DP</span><span>錛屾柟娉曟瘮杈冨閥濡欍?em>鍛靛懙錛岃璁插緱鏇存繁鐐癸紝絳夋垜鍙樻垚鐗涗漢鍦ㄧ畫鍚?#8230;…</em></span></p> <p><span><span>       </span></span><span>涔?jié)銆?/span><span>2738 Two Ends</span></p> <p><span><span>       </span></span><span>鏈夌偣鎯沖崥寮堢殑棰樼洰錛屾垜浜嬬敤</span><span>dp</span><span>鏉ュ仛鐨勩傛湁涓緇勬暟錛屼袱涓漢鍒嗗埆杞祦浠庢暟緇勪袱澶村彇鏁幫紝絎竴涓彇鏁扮殑浜哄彲浠ラ夌敤浠繪剰鐨勭瓥鐣ワ紝絎簩涓漢鍒欒涓鐩翠嬌鐢ㄨ椽蹇冪瓥鐣ャ傞棶鏈鍚庣涓涓漢鎵鍙栧緱鐨勬暟瀛椾箣鍜屾瘮絎簩涓漢鍙栧緱鐨勬暟瀛椾箣鍜屾渶澶氬澶氬皯銆?/span></p> <p><span><span>       </span></span><span>寰堝鏄撴兂鍒?/span><span>DP</span><span>錛岀浜屼釜浜虹殑鍙栨暟瑙勫垯鏄竴瀹氱殑錛屽彧鏈夌涓涓釜浜哄彲浠ラ夋嫨錛岄偅涔堝湪絎竴涓漢鍙栨暟鐨勬椂鍊欏氨鏈夌姸鎬佽漿縐繪柟紼嬶紝</span><span>dp[i][j]</span><span>琛ㄧず鍓嶉潰鏄</span><span>i</span><span>涓暟鍚庨潰鏄</span><span>j</span><span>涓暟鐨勬椂鍊欑涓涓漢鎵鑳藉緱鍒版暟瀛楀拰鐨勬渶澶у箋?/span></p> <p><span>if(dp[i][j]+a[i]>dp[i+1][j])</span></p> <p><span><span>                                   </span>dp[i+1][j]=dp[i][j]+a[i];<span>              </span>//</span><span>鍙栧墠闈㈢殑鏁?/span></p> <p><span><span>                            </span>if(dp[i][j]+a[j]>dp[i][j-1])</span></p> <p><span><span>                                   </span>dp[i][j-1]=dp[i][j]+a[j];<span>        </span>//</span><span>鍙栧悗闈㈢殑鏁?/span></p> <p><span>閭d箞絎簩涓漢鐨勭姸鎬佽漿縐誨氨鐩稿姣旇緝濂界‘瀹氫簡錛?/span></p> <p><span>if(a[i]<a[j] && dp[i][j]!=-1 && dp[i][j]>dp[i][j-1])</span></p> <p><span><span>                            </span>dp[i][j-1]=dp[i][j];</span></p> <p><span><span>                     </span>if(a[i]>=a[j] && dp[i][j]!=-1 && dp[i][j]>dp[i+1][j])</span></p> <p><span><span>                            </span>dp[i+1][j]=dp[i][j];</span></p> <p><span>鏈鍚庝竴姝ュ彧闇姣旇緝</span><span>dp[i][i]</span><span>鐨勫鹼紝閫夊叾涓渶澶х殑鍑烘潵灝辮浜?/span><span>^_^ </span></p> <img src ="http://www.shnenglu.com/linyangfei/aggbug/32674.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/linyangfei/" target="_blank">椋為</a> 2007-09-22 17:06 <a href="http://www.shnenglu.com/linyangfei/archive/2007/09/22/32674.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <a href="http://www.shnenglu.com/">青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品</a> <div style="position:fixed;left:-9000px;top:-9000px;"><font id="pjuwb"></font><button id="pjuwb"><pre id="pjuwb"></pre></button><sub id="pjuwb"></sub><tbody id="pjuwb"><var id="pjuwb"><address id="pjuwb"></address></var></tbody><listing id="pjuwb"><label id="pjuwb"><strong id="pjuwb"></strong></label></listing><wbr id="pjuwb"><small id="pjuwb"><tbody id="pjuwb"></tbody></small></wbr><ins id="pjuwb"><xmp id="pjuwb"></xmp></ins><style id="pjuwb"></style><label id="pjuwb"><em id="pjuwb"><li id="pjuwb"></li></em></label><samp id="pjuwb"></samp><menu id="pjuwb"><input id="pjuwb"></input></menu><pre id="pjuwb"><tbody id="pjuwb"><tfoot id="pjuwb"><button id="pjuwb"></button></tfoot></tbody></pre><form id="pjuwb"></form><i id="pjuwb"><style id="pjuwb"><label id="pjuwb"><sup id="pjuwb"></sup></label></style></i><li id="pjuwb"><table id="pjuwb"><abbr id="pjuwb"></abbr></table></li><video id="pjuwb"></video><dfn id="pjuwb"></dfn><progress id="pjuwb"></progress><strong id="pjuwb"></strong><mark id="pjuwb"></mark><em id="pjuwb"></em><tbody id="pjuwb"><p id="pjuwb"><strike id="pjuwb"><acronym id="pjuwb"></acronym></strike></p></tbody><option id="pjuwb"></option><strike id="pjuwb"></strike><u id="pjuwb"></u><td id="pjuwb"><center id="pjuwb"><tr id="pjuwb"></tr></center></td><em id="pjuwb"><mark id="pjuwb"><em id="pjuwb"><tt id="pjuwb"></tt></em></mark></em><strong id="pjuwb"></strong><wbr id="pjuwb"></wbr><s id="pjuwb"></s><strong id="pjuwb"></strong><legend id="pjuwb"></legend><nav id="pjuwb"></nav><dl id="pjuwb"><th id="pjuwb"><dl id="pjuwb"></dl></th></dl><noframes id="pjuwb"><ins id="pjuwb"></ins></noframes><font id="pjuwb"></font><strike id="pjuwb"><i id="pjuwb"><style id="pjuwb"><label id="pjuwb"></label></style></i></strike><output id="pjuwb"></output><thead id="pjuwb"><pre id="pjuwb"></pre></thead><source id="pjuwb"></source><menuitem id="pjuwb"><wbr id="pjuwb"></wbr></menuitem><pre id="pjuwb"><span id="pjuwb"><pre id="pjuwb"><big id="pjuwb"></big></pre></span></pre><cite id="pjuwb"><fieldset id="pjuwb"><s id="pjuwb"><rt id="pjuwb"></rt></s></fieldset></cite><big id="pjuwb"><progress id="pjuwb"><big id="pjuwb"></big></progress></big><samp id="pjuwb"><delect id="pjuwb"></delect></samp><dl id="pjuwb"></dl><strike id="pjuwb"><nav id="pjuwb"><dl id="pjuwb"><strong id="pjuwb"></strong></dl></nav></strike><tbody id="pjuwb"><b id="pjuwb"><optgroup id="pjuwb"><rp id="pjuwb"></rp></optgroup></b></tbody><em id="pjuwb"></em><xmp id="pjuwb"><blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote></xmp> <i id="pjuwb"><abbr id="pjuwb"><i id="pjuwb"><abbr id="pjuwb"></abbr></i></abbr></i><center id="pjuwb"><acronym id="pjuwb"><center id="pjuwb"></center></acronym></center><pre id="pjuwb"></pre><ul id="pjuwb"><thead id="pjuwb"></thead></ul><blockquote id="pjuwb"><pre id="pjuwb"><sup id="pjuwb"></sup></pre></blockquote><acronym id="pjuwb"></acronym><big id="pjuwb"><s id="pjuwb"></s></big><th id="pjuwb"></th><th id="pjuwb"></th><tbody id="pjuwb"></tbody><thead id="pjuwb"><strike id="pjuwb"></strike></thead><th id="pjuwb"><dl id="pjuwb"><wbr id="pjuwb"></wbr></dl></th><dl id="pjuwb"><strong id="pjuwb"></strong></dl><abbr id="pjuwb"><noframes id="pjuwb"><noscript id="pjuwb"></noscript></noframes></abbr><td id="pjuwb"><ol id="pjuwb"></ol></td><li id="pjuwb"><noscript id="pjuwb"><abbr id="pjuwb"></abbr></noscript></li><small id="pjuwb"><bdo id="pjuwb"><nav id="pjuwb"></nav></bdo></small><style id="pjuwb"></style><optgroup id="pjuwb"><table id="pjuwb"></table></optgroup><center id="pjuwb"><tr id="pjuwb"><dfn id="pjuwb"></dfn></tr></center><th id="pjuwb"></th><u id="pjuwb"></u><tfoot id="pjuwb"><legend id="pjuwb"><i id="pjuwb"></i></legend></tfoot><mark id="pjuwb"></mark><meter id="pjuwb"></meter><nav id="pjuwb"></nav><acronym id="pjuwb"><pre id="pjuwb"><acronym id="pjuwb"><ul id="pjuwb"></ul></acronym></pre></acronym><acronym id="pjuwb"><pre id="pjuwb"><acronym id="pjuwb"><ul id="pjuwb"></ul></acronym></pre></acronym><nobr id="pjuwb"></nobr><sub id="pjuwb"><th id="pjuwb"><menuitem id="pjuwb"><wbr id="pjuwb"></wbr></menuitem></th></sub><thead id="pjuwb"><sub id="pjuwb"></sub></thead><ul id="pjuwb"><address id="pjuwb"><menuitem id="pjuwb"><meter id="pjuwb"></meter></menuitem></address></ul><dfn id="pjuwb"></dfn><pre id="pjuwb"></pre><input id="pjuwb"><cite id="pjuwb"><fieldset id="pjuwb"></fieldset></cite></input><u id="pjuwb"><form id="pjuwb"><u id="pjuwb"></u></form></u><kbd id="pjuwb"><em id="pjuwb"><mark id="pjuwb"></mark></em></kbd><tr id="pjuwb"></tr><del id="pjuwb"><form id="pjuwb"><address id="pjuwb"></address></form></del><tfoot id="pjuwb"><legend id="pjuwb"><ol id="pjuwb"><dl id="pjuwb"></dl></ol></legend></tfoot><menu id="pjuwb"><nobr id="pjuwb"><th id="pjuwb"><nobr id="pjuwb"></nobr></th></nobr></menu><fieldset id="pjuwb"></fieldset><pre id="pjuwb"><blockquote id="pjuwb"><samp id="pjuwb"></samp></blockquote></pre><xmp id="pjuwb"><sup id="pjuwb"><pre id="pjuwb"></pre></sup></xmp><span id="pjuwb"><progress id="pjuwb"></progress></span><font id="pjuwb"></font><var id="pjuwb"><abbr id="pjuwb"></abbr></var><strong id="pjuwb"><label id="pjuwb"><i id="pjuwb"><legend id="pjuwb"></legend></i></label></strong><tr id="pjuwb"><em id="pjuwb"><em id="pjuwb"><output id="pjuwb"></output></em></em></tr><thead id="pjuwb"><strike id="pjuwb"></strike></thead> <acronym id="pjuwb"></acronym><i id="pjuwb"></i><tt id="pjuwb"></tt><rt id="pjuwb"><source id="pjuwb"><rt id="pjuwb"></rt></source></rt><strike id="pjuwb"><acronym id="pjuwb"></acronym></strike><del id="pjuwb"></del><font id="pjuwb"><output id="pjuwb"><ins id="pjuwb"><output id="pjuwb"></output></ins></output></font><kbd id="pjuwb"><tr id="pjuwb"><kbd id="pjuwb"></kbd></tr></kbd><pre id="pjuwb"><sup id="pjuwb"><delect id="pjuwb"><samp id="pjuwb"></samp></delect></sup></pre><samp id="pjuwb"></samp><track id="pjuwb"></track><tr id="pjuwb"></tr><center id="pjuwb"></center><fieldset id="pjuwb"></fieldset><i id="pjuwb"></i><td id="pjuwb"></td><rt id="pjuwb"></rt><object id="pjuwb"></object><pre id="pjuwb"><progress id="pjuwb"><sub id="pjuwb"><thead id="pjuwb"></thead></sub></progress></pre><kbd id="pjuwb"><tr id="pjuwb"><option id="pjuwb"></option></tr></kbd><output id="pjuwb"><ins id="pjuwb"></ins></output><ol id="pjuwb"></ol><source id="pjuwb"></source><strong id="pjuwb"></strong><ruby id="pjuwb"></ruby><sub id="pjuwb"><meter id="pjuwb"><menuitem id="pjuwb"><meter id="pjuwb"></meter></menuitem></meter></sub><pre id="pjuwb"></pre><center id="pjuwb"></center><tr id="pjuwb"><tbody id="pjuwb"><xmp id="pjuwb"><dd id="pjuwb"></dd></xmp></tbody></tr><video id="pjuwb"></video><pre id="pjuwb"></pre><form id="pjuwb"><optgroup id="pjuwb"></optgroup></form><samp id="pjuwb"></samp><kbd id="pjuwb"></kbd><strong id="pjuwb"><option id="pjuwb"></option></strong><object id="pjuwb"></object><abbr id="pjuwb"><noframes id="pjuwb"><abbr id="pjuwb"></abbr></noframes></abbr><ul id="pjuwb"><del id="pjuwb"><button id="pjuwb"><pre id="pjuwb"></pre></button></del></ul><abbr id="pjuwb"></abbr><strong id="pjuwb"><code id="pjuwb"><strong id="pjuwb"></strong></code></strong><option id="pjuwb"></option><optgroup id="pjuwb"><bdo id="pjuwb"><code id="pjuwb"></code></bdo></optgroup><mark id="pjuwb"><em id="pjuwb"><font id="pjuwb"></font></em></mark><acronym id="pjuwb"><code id="pjuwb"></code></acronym><dl id="pjuwb"></dl><em id="pjuwb"></em><object id="pjuwb"><input id="pjuwb"><object id="pjuwb"></object></input></object><output id="pjuwb"><dd id="pjuwb"></dd></output><option id="pjuwb"><button id="pjuwb"><option id="pjuwb"></option></button></option><small id="pjuwb"></small></div> <a href="http://eshop999.com" target="_blank">亚洲日韩视频</a>| <a href="http://9a9u.com" target="_blank">久久人人爽爽爽人久久久</a>| <a href="http://lukushe.com" target="_blank">久久一区二区三区四区五区</a>| <a href="http://yw1998.com" target="_blank">国产午夜精品久久久</a>| <a href="http://mmmm37.com" target="_blank">久久久久久欧美</a>| <a href="http://www48929.com" target="_blank">久久五月天婷婷</a>| <a href="http://www-xj788.com" target="_blank">亚洲国产成人精品视频</a>| <a href="http://75pppp.com" target="_blank">欧美激情女人20p</a>| <a href="http://syntheticnets.com" target="_blank">欧美电影在线播放</a>| <a href="http://8xn66w.com" target="_blank">亚洲素人一区二区</a>| <a href="http://qcjpns.com" target="_blank">欧美亚洲免费</a>| <a href="http://833077.com" target="_blank">亚洲国产精品久久久久秋霞影院 </a>| <a href="http://jjy891.com" target="_blank">亚洲视频免费看</a>| <a href="http://tutu80.com" target="_blank">99re热这里只有精品视频</a>| <a href="http://www0505nn.com" target="_blank">欧美日韩一区二区视频在线</a>| <a href="http://7811c.com" target="_blank">午夜日韩视频</a>| <a href="http://xaipad.com" target="_blank">久久久久久伊人</a>| <a href="http://05078888.com" target="_blank">一区二区三区 在线观看视频</a>| <a href="http://www-438686.com" target="_blank">在线亚洲自拍</a>| <a href="http://zgztby.com" target="_blank">一区二区三区在线观看欧美</a>| <a href="http://aotaotao.com" target="_blank">亚洲精品国产精品乱码不99</a>| <a href="http://666675com.com" target="_blank">欧美日本高清视频</a>| <a href="http://avtb2068.com" target="_blank">久久精品伊人</a>| <a href="http://bocai4488.com" target="_blank">欧美电影资源</a>| <a href="http://juegold.com" target="_blank">久久国产日韩欧美</a>| <a href="http://xy3977.com" target="_blank">欧美日本国产视频</a>| <a href="http://430390.com" target="_blank">久久免费少妇高潮久久精品99</a>| <a href="http://133969.com" target="_blank">久热国产精品</a>| <a href="http://aabbcc11.com" target="_blank">欧美亚洲一区在线</a>| <a href="http://sxhrsmjj.com" target="_blank">欧美成人性生活</a>| <a href="http://gykfqzgpt.com" target="_blank">久久精品国产综合精品</a>| <a href="http://25axxa.com" target="_blank">欧美丰满少妇xxxbbb</a>| <a href="http://cnm24.com" target="_blank">久久疯狂做爰流白浆xx</a>| <a href="http://tianxiantxtv.com" target="_blank">欧美成人午夜激情视频</a>| <a href="http://azaz7.com" target="_blank">久久久久欧美</a>| <a href="http://mimi78.com" target="_blank">国产精品福利在线</a>| <a href="http://mgcc37.com" target="_blank">亚洲最新视频在线</a>| <a href="http://yjdm296.com" target="_blank">国产手机视频一区二区</a>| <a href="http://www344399.com" target="_blank">亚洲日本视频</a>| <a href="http://wwwnnnn.com" target="_blank">狠狠色丁香久久综合频道 </a>| <a href="http://tk99444.com" target="_blank">亚洲欧美日韩在线不卡</a>| <a href="http://sinojinxing.com" target="_blank">久久精品首页</a>| <a href="http://www-474736.com" target="_blank">午夜精品视频在线</a>| <a href="http://yye321.com" target="_blank">欧美日韩另类字幕中文</a>| <a href="http://660507jj.com" target="_blank">欧美18av</a>| <a href="http://bosengame.com" target="_blank">激情久久久久</a>| <a href="http://4438x28.com" target="_blank">亚洲在线日韩</a>| <a href="http://767296.com" target="_blank">亚洲深夜影院</a>| <a href="http://sclddn.com" target="_blank">欧美激情1区2区3区</a>| <a href="http://989766.com" target="_blank">免费一区视频</a>| <a href="http://www-544778.com" target="_blank">国产一区二区精品丝袜</a>| <a href="http://belerbb.com" target="_blank">正在播放亚洲一区</a>| <a href="http://v58q.com" target="_blank">亚洲午夜成aⅴ人片</a>| <a href="http://cnc800.com" target="_blank">欧美国产日韩精品免费观看</a>| <a href="http://2996611.com" target="_blank">免费不卡欧美自拍视频</a>| <a href="http://yw1396.com" target="_blank">国产日韩精品在线</a>| <a href="http://qibilly.com" target="_blank">亚洲在线一区二区</a>| <a href="http://www-44469.com" target="_blank">午夜精品三级视频福利</a>| <a href="http://yiqiluntan.com" target="_blank">欧美视频一区二区三区…</a>| <a href="http://281191.com" target="_blank">亚洲清纯自拍</a>| <a href="http://df7166.com" target="_blank">亚洲久色影视</a>| <a href="http://by3259.com" target="_blank">欧美激情影音先锋</a>| <a href="http://sdjzzs.com" target="_blank">亚洲国产一区二区三区a毛片</a>| <a href="http://www780yy.com" target="_blank">亚洲第一黄色网</a>| <a href="http://www39pao.com" target="_blank">久久国产99</a>| <a href="http://xmzszx.com" target="_blank">久热精品视频在线观看</a>| <a href="http://qdpetlove.com" target="_blank">国产一区二区久久</a>| <a href="http://78757a.com" target="_blank">久久精品在线播放</a>| <a href="http://16355t.com" target="_blank">免费美女久久99</a>| <a href="http://www218999.com" target="_blank">亚洲成色777777女色窝</a>| <a href="http://maomi54.com" target="_blank">免费久久99精品国产自</a>| <a href="http://l5076.com" target="_blank">欧美国产一区在线</a>| <a href="http://www284tv.com" target="_blank">91久久嫩草影院一区二区</a>| <a href="http://91ypp.com" target="_blank">欧美成人69av</a>| <a href="http://958997.com" target="_blank">亚洲伦伦在线</a>| <a href="http://filmcameralibrary.com" target="_blank">在线视频免费在线观看一区二区</a>| <a href="http://caox8.com" target="_blank">欧美日产在线观看</a>| <a href="http://jjy891.com" target="_blank">亚洲婷婷综合色高清在线</a>| <a href="http://8xv0.com" target="_blank">午夜精品久久久久</a>| <a href="http://ycgg008.com" target="_blank">国产一区二区三区高清在线观看</a>| <a href="http://eee2244.com" target="_blank">久久aⅴ国产欧美74aaa</a>| <a href="http://tutu80.com" target="_blank">美女性感视频久久久</a>| <a href="http://389746.com" target="_blank">亚洲欧洲一区二区天堂久久 </a>| <a href="http://sz-jyqj.com" target="_blank">亚洲欧美中日韩</a>| <a href="http://xpj694.com" target="_blank">久久久www</a>| <a href="http://www442222.com" target="_blank">亚洲国产二区</a>| <a href="http://xingmaokeji.com" target="_blank">欧美日韩精品中文字幕</a>| <a href="http://x1317.com" target="_blank">亚洲视频视频在线</a>| <a href="http://gmqgw.com" target="_blank">久久免费视频一区</a>| <a href="http://www353488.com" target="_blank">亚洲精品视频一区</a>| <a href="http://22127c.com" target="_blank">欧美视频一区二区</a>| <a href="http://060969.com" target="_blank">久久精品女人的天堂av</a>| <a href="http://wwwlywbb.com" target="_blank">亚洲电影观看</a>| <a href="http://missav88.com" target="_blank">亚洲一区二区在线</a>| <a href="http://850cn.com" target="_blank">国产一区二区激情</a>| <a href="http://318823.com" target="_blank">欧美理论片在线观看</a>| <a href="http://414794.com" target="_blank">亚洲免费网址</a>| <a href="http://798814.com" target="_blank">亚洲高清久久久</a>| <a href="http://m10669.com" target="_blank">亚洲综合视频网</a>| <a href="http://dv6699.com" target="_blank">精品成人一区二区三区</a>| <a href="http://6k7a.com" target="_blank">欧美日韩一区二区三区高清</a>| <a href="http://dracotek.com" target="_blank">午夜欧美大尺度福利影院在线看</a>| <a href="http://sihu1515hh.com" target="_blank">麻豆精品精华液</a>| <a href="http://k37b.com" target="_blank">9久草视频在线视频精品</a>| <a href="http://dv6699.com" target="_blank">亚洲在线第一页</a>| <a href="http://wwwnnnn.com" target="_blank">激情成人亚洲</a>| <a href="http://33wbwb.com" target="_blank">欧美日韩在线播放三区</a>| <a href="http://hlyjh.com" target="_blank">久久国产欧美精品</a>| <a href="http://xxxsxx.com" target="_blank">一本色道久久99精品综合</a>| <a href="http://by71222.com" target="_blank">亚洲人体一区</a>| <a href="http://qibilly.com" target="_blank">蜜臀a∨国产成人精品</a>| <a href="http://tyaisen.com" target="_blank">一本色道久久加勒比精品</a>| <a href="http://www38044.com" target="_blank">久久久久久久97</a>| <a href="http://booyitech.com" target="_blank">亚洲另类黄色</a>| <a href="http://www50050.com" target="_blank">国语自产精品视频在线看一大j8</a>| <a href="http://haose23.com" target="_blank">欧美精品久久一区</a>| <a href="http://wwww76.com" target="_blank">久久免费黄色</a>| <a href="http://jzsp87.com" target="_blank">亚洲欧美另类中文字幕</a>| <a href="http://339505.com" target="_blank">亚洲级视频在线观看免费1级</a>| <a href="http://3315588.com" target="_blank">久久国产精品一区二区三区</a>| <a href="http://www381818.com" target="_blank">99re在线精品</a>| <a href="http://nmbgbc.com" target="_blank">亚洲高清成人</a>| <a href="http://www92994.com" target="_blank">狠狠干综合网</a>| <a href="http://xaxkizlar.com" target="_blank">国产精品美女</a>| <a href="http://91pero.com" target="_blank">欧美日韩免费在线</a>| <a href="http://787282.com" target="_blank">欧美91大片</a>| <a href="http://jxyptsw.com" target="_blank">久久综合狠狠综合久久综合88</a>| <a href="http://babylonmovi.com" target="_blank">亚洲视频每日更新</a>| <a href="http://www-44899.com" target="_blank">91久久国产综合久久蜜月精品 </a>| <a href="http://990288.com" target="_blank">亚洲第一黄网</a>| <a href="http://shalxee.com" target="_blank">国产日韩欧美制服另类</a>| <a href="http://4466777.com" target="_blank">国产精品毛片a∨一区二区三区</a>| <a href="http://www-236677.com" target="_blank">欧美v日韩v国产v</a>| <a href="http://wwwavtb1122.com" target="_blank">久久精品国产欧美激情</a>| <a href="http://562595.com" target="_blank">亚洲午夜高清视频</a>| <a href="http://wwwnnnn.com" target="_blank">亚洲午夜精品一区二区三区他趣</a>| <a href="http://qkspvip.com" target="_blank">亚洲人成网站999久久久综合</a>| <a href="http://czhqwy.com" target="_blank">欧美大片在线观看</a>| <a href="http://cca22.com" target="_blank">欧美gay视频激情</a>| <a href="http://www38ccc.com" target="_blank">裸体女人亚洲精品一区</a>| <a href="http://233116.com" target="_blank">久久综合狠狠</a>| <a href="http://4254888.com" target="_blank">久久亚洲国产精品日日av夜夜</a>| <a href="http://yishangsh.com" target="_blank">亚洲欧美在线免费</a>| <a href="http://123086.com" target="_blank">欧美伊人久久久久久久久影院 </a>| <a href="http://whaylan.com" target="_blank">99精品热视频只有精品10</a>| <a href="http://cabenn.com" target="_blank">精品成人国产在线观看男人呻吟</a>| <a href="http://99999zc.com" target="_blank">国产色视频一区</a>| <a href="http://988tz.com" target="_blank">国产一区清纯</a>| <a href="http://yiqipapa8.com" target="_blank">国产主播精品</a>| <a href="http://621765.com" target="_blank">精品成人一区二区三区四区</a>| <a href="http://082235.com" target="_blank">国产性做久久久久久</a>| <a href="http://ssis378.com" target="_blank">国产一区二区主播在线</a>| <a href="http://gs-qintai.com" target="_blank">国产一区二区在线免费观看 </a>| <a href="http://17cao8.com" target="_blank">国产色婷婷国产综合在线理论片a</a>| <a href="http://xsjj10.com" target="_blank">国产欧美精品va在线观看</a>| <a href="http://aaddgg66.com" target="_blank">国产精品综合色区在线观看</a>| <a href="http://339505.com" target="_blank">国产日韩一区二区三区</a>| <a href="http://moonshile.com" target="_blank">国内精品久久久久久久97牛牛</a>| <a href="http://916969.com" target="_blank">国产午夜精品久久久久久久</a>| <a href="http://www387333.com" target="_blank">黄色成人在线免费</a>| <a href="http://543199.com" target="_blank">亚洲欧洲日韩女同</a>| <a href="http://wwwbbb888999.com" target="_blank">一本色道久久加勒比88综合 </a>| <a href="http://seqingdao.com" target="_blank">国产综合一区二区</a>| <a href="http://mom8888.com" target="_blank">尤物精品在线</a>| <a href="http://shiselol.com" target="_blank">夜夜精品视频一区二区</a>| <a href="http://cxjzcl.com" target="_blank">午夜视频一区二区</a>| <a href="http://7m08.com" target="_blank">久久伊人免费视频</a>| <a href="http://096577.com" target="_blank">亚洲黄色毛片</a>| <a href="http://qiezi2vip.com" target="_blank">亚洲一区尤物</a>| <a href="http://a718sx.com" target="_blank">欧美婷婷在线</a>| <a href="http://ccc982.com" target="_blank">国产精品狠色婷</a>| <a href="http://haomscq.com" target="_blank">国模 一区 二区 三区</a>| <a href="http://556995.com" target="_blank">亚洲精品乱码久久久久久</a>| <a href="http://lalandapps.com" target="_blank">日韩亚洲在线观看</a>| <a href="http://xiaobi13.com" target="_blank">欧美影视一区</a>| <a href="http://www149aa.com" target="_blank">欧美大片18</a>| <a href="http://107766a.com" target="_blank">亚洲欧美激情在线视频</a>| <a href="http://scratbag.com" target="_blank">久久人人爽爽爽人久久久</a>| <a href="http://1177898.com" target="_blank">欧美日韩美女在线观看</a>| <a href="http://rainbowbpm.com" target="_blank">国产一区二区欧美日韩</a>| <a href="http://668334.com" target="_blank">日韩一级二级三级</a>| <a href="http://www99mmnn.com" target="_blank">久久婷婷成人综合色</a>| <a href="http://www-772773.com" target="_blank">亚洲人成小说网站色在线</a>| <a href="http://tristooges.com" target="_blank">亚洲欧美日韩专区</a>| <a href="http://www-3844444.com" target="_blank">欧美国产日韩精品免费观看</a>| <a href="http://gmqgw.com" target="_blank">国产日韩欧美成人</a>| <a href="http://heyzo1199.com" target="_blank">一区电影在线观看</a>| <a href="http://0061366.com" target="_blank">久久免费一区</a>| <a href="http://cuucs.com" target="_blank">亚洲午夜一区二区</a>| <a href="http://998609.com" target="_blank">欧美大色视频</a>| <a href="http://65kf.com" target="_blank">韩国三级在线一区</a>| <a href="http://3dmh329.com" target="_blank">亚洲男人的天堂在线aⅴ视频</a>| <a href="http://qdpetlove.com" target="_blank">欧美成人午夜影院</a>| <a href="http://susan5.com" target="_blank">亚洲欧美精品伊人久久</a>| <a href="http://ynjzwh.com" target="_blank">欧美激情在线观看</a>| <a href="http://www-77663.com" target="_blank">激情久久综艺</a>| <a href="http://wansilv.com" target="_blank">欧美综合国产精品久久丁香</a>| <a href="http://qkspvip.com" target="_blank">亚洲精选在线观看</a>| <a href="http://2061375.com" target="_blank">免费一级欧美片在线观看</a>| <a href="http://8p3c.com" target="_blank">国内外成人免费激情在线视频 </a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>