2013年5月2日

UVa 10617 - Again Palindrome 字符串dp

摘要: Problem IAgain PalindromesInput:Standard InputOutput:Standard OutputTime Limit:2 SecondsA palindorme is a sequence of one or more characters that reads the same from the left as it does from the right. For example,Z,TOTandMADAMare palindromes, butADAMis not.Given a sequenceSofNcapital latin letters. 阅读全文

posted @ 2013-05-02 20:19 电子幼体 阅读(170) 评论(0) 推荐(0) 编辑

UVa 10271 - Chopsticks dp

摘要: Problem CChopsticksInput:Standard InputOutput:Standard OutputIn China, people use a pair of chopsticks to get food on the table, but Mr. L is a bit different. He uses a set of three chopsticks -- one pair, plus an EXTRA long chopstick to get some big food by piercing it through the food. As you may 阅读全文

posted @ 2013-05-02 19:36 电子幼体 阅读(204) 评论(0) 推荐(0) 编辑

UVa 10739 - String to Palindrome 字符串dp

摘要: Problem HString to PalindromeInput:Standard InputOutput:Standard OutputTime Limit:1 SecondIn this problem you are asked to convert a string into a palindrome with minimum number of operations. The operations are described below:Here you’d have the ultimate freedom. You are allowed to:Add any charact 阅读全文

posted @ 2013-05-02 18:48 电子幼体 阅读(170) 评论(0) 推荐(0) 编辑

UVa 10651 - Pebble Solitaire 状态压缩 dp

摘要: Problem APebble SolitaireInput:standard inputOutput:standard outputTime Limit:1 secondPebble solitaire is an interesting game. This is a game where you are given a board with an arrangement of small cavities, initially all but one occupied by a pebble each. The aim of the game is to remove as many p 阅读全文

posted @ 2013-05-02 16:13 电子幼体 阅读(166) 评论(0) 推荐(0) 编辑

导航