摘要: JugsTime Limit:2 Seconds Memory Limit:65536 KB Special JudgeIn the movie "Die Hard 3", Bruce Willis and Samuel L. Jackson were confronted with the following puzzle. They were given a 3-gallon jug and a 5-gallon jug and were asked to fill the 5-gallon jug with exactly 4 gallons. This proble 阅读全文
posted @ 2012-12-13 23:24 lssnail 阅读(187) 评论(0) 推荐(0) 编辑
摘要: Anagrams by StackTime Limit:2 Seconds Memory Limit:65536 KBHow can anagrams result from sequences of stack operations? There are two sequences of stack operators which can convert TROT to TORT:[i i i i o o o oi o i i o o i o]whereistands for Push andostands for Pop. Your program should, given pairs 阅读全文
posted @ 2012-12-13 23:21 lssnail 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Crashing BalloonTime Limit:2 Seconds Memory Limit:65536 KBOn every June 1st, the Children's Day, there will be a game named "crashing balloon" on TV. The rule is very simple. On the ground there are 100 labeled balloons, with the numbers 1 to 100. After the referee shouts "Let' 阅读全文
posted @ 2012-12-13 23:16 lssnail 阅读(344) 评论(0) 推荐(0) 编辑