随笔分类 - OJ_ZOJ
摘要:Monkey and BananaTime Limit:2 Seconds Memory Limit:65536 KBA group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, and at the mean time, provide the monkey with some blocks. If the monkey is clever enough, it shall be able to
阅读全文
摘要:Match for BonusTime Limit:2 Seconds Memory Limit:65536 KBRoy played a game with his roommates the other day.His roommates wrote 2 strings of characters, and gave each character a bonus value. When Roy pinned the positions of one common character in the 2 strings, the bonus value of that character wo
阅读全文
摘要:Fire NetTime Limit:2 Seconds Memory Limit:65536 KBSuppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representing a street or a piece of wall.A blockhouse is a small castle that has four openings through which to shoot. The fou
阅读全文
摘要:PalindromesTime Limit: 2 Seconds Memory Limit: 65536 KBA regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string "ABCDEDCBA" is a palindrome because it is the same when the string is read from left to right as when the string is re
阅读全文
摘要:Japanese Mahjong IIITime Limit: 2 Seconds Memory Limit: 65536 KBMahjong is a game of skill, strategy and calculation and involves a certain degree of chance. In this problem, we concentrate on Japanese Mahjong, a variation of mahjong. For brief, all of the word mahjong mentioned following refer to .
阅读全文
摘要:Rock, Scissors, PaperTime Limit: 5 Seconds Memory Limit: 32768 KBBart's sister Lisa has created a new civilization on a two-dimensional grid. At the outset each grid location may be occupied by one of three life forms: Rocks, Scissors, or Papers. Each day, differing life forms occupying horizont
阅读全文
摘要:Matrix Chain MultiplicationTime Limit: 2 Seconds Memory Limit: 65536 KBMatrix multiplication problem is a typical example of dynamical programming.Suppose you have to evaluate an expression like A*B*C*D*E where A,B,C,D and E are matrices. Since matrix multiplication is associative, the order in whi.
阅读全文