题目大意是给出n组包含2个关键字的元素,求同时满足第一个关键字递增和第二个关键字递减的序列的最长长度以及输出其中一个满足条件的序列。
对于要求两个关键字同时分别满足不降/不升,我们可以先对一个关键字进行排序,则实际上只需对另一个关键字进行DP即可求解。由于n<=1000所以用O(n^2)的DP就可以AC了。不过实际上用O(nlogn)的DP也是可以做的,只是因为存在相同数字的情况不能直接顺推,需要对序列求反(即对排序关键字的条件取反),利用一个数组记录下更新序列过程中更新的每一个元素在序列中的前一个元素,最后倒推出整个合法的序列。
3002145 2008-07-24 15:07:51 Accepted 1108 FPC 00:00.00 412K IwfWcf@LZOI
oakley sunglasses wholesale, http://www.oakleysunglasses-wholesale.us.com/
回复删除ugg boots, http://www.uggbootscheap.eu.com/
ralph lauren uk, http://www.ralphlaurenoutletuk.org.uk/
thomas sabo uk, http://www.thomassabos.co.uk/
michael kors factory outlet, http://www.michaelkorsfactoryoutletonline.com/
michael kors factory outlet, http://www.michaelkorsfactoryoutlets.in.net/
michael kors handbags, http://www.michaelkorshandbagsoutletstore.us.com/
oakley sunglasses, http://www.oakleysunglasseswholesale.in.net/
oakley, http://www.occhialioakleyoutlets.it/
oakley sunglasses wholesale, http://www.oakleysunglasseswholesale.us.com/
tory burch shoes, http://www.toryburchshoesoutlet.com/
pandora jewelry, http://www.pandorajewelryoutlet.us.com/
hollister uk, http://www.hollistershirts.co.uk/
cheap nba jerseys, http://www.nbajerseys.net/
fitflop, http://www.fitflop.in.net/
louis vuitton, http://www.borselouisvuittonoutlet.it/
juicy couture outlet, http://www.juicycoutureoutlet.net/
coach outlet, http://www.coachoutletus.us/
oakley sunglasses, http://www.oakley.in.net/
rolex watches uk, http://www.rolexwatches-uk.co.uk/
longchamp outlet, http://www.longchampoutlet.name/
michael kors bags, http://www.michaelkorsbags.uk/
michael kors outlet, http://www.michaelkors-outlets.us.com/
ugg boots, http://www.uggbootsclearance.in.net/
nike air max shoes, http://www.nikeairmaxshoess.co.uk/
links of london, http://www.linksoflondons.co.uk/
michael kors outlet, http://www.michaelkorsoutletusa.net/
designer handbags, http://www.designerhandbags.us.com/
ray ban sunglasses, http://www.raybansunglass.co.uk/
1003maoqiuyun
miami heat jersey
回复删除fitflops sale
christian louboutin outlet
ralph lauren uk
ralph lauren polo
ferragamo shoes
packers jerseys
mlb jerseys
raiders jerseys
回复删除miami heat
oakland raiders jerseys
nike soccer shoes
bengals jersey
boston celtics jersey
visit 9a replica bags learn the facts here now replica bags joy More Bonuses replica bags in dubai
回复删除g9u51k9v36 k0h45o4z81 j8n90w6u89 e0u30w5x74 g7e43y1k34 h2z55q8u55
回复删除