摘要: A and B are playing a shooting game on a battlefield consisting of square-shaped unit blocks. The blocks are occupying some consecutive columns, and the perimeter of the figure equals the perimeter of its minimal bounding box. The figure (a) below is a valid battlefield, but (b) and (c) are not, bec 阅读全文
posted @ 2013-08-23 23:06 Oyking 阅读(386) 评论(0) 推荐(0) 编辑
摘要: You live in a small town withRbidirectional roads connectingCcrossings and you want to go from crossing 1 to crossingCas soon as possible. You can visit other crossings before arriving at crossingC, but it's not mandatory.You have exactly one chance to ask your friend to repair exactly one exist 阅读全文
posted @ 2013-08-23 22:45 Oyking 阅读(716) 评论(0) 推荐(0) 编辑
摘要: You have a maze with obstacles and non-zero digits in it:You can start from any square, walk in the maze, and finally stop at some square. Each step, you may only walk into one of thefour neighbouring squares (up, down, left, right)and you cannot walk into obstacles or walk into a square more than o 阅读全文
posted @ 2013-08-23 22:17 Oyking 阅读(1431) 评论(0) 推荐(0) 编辑
摘要: In finance, Internal Rate of Return (IRR) is the discount rate of an investment when NPV equals zero. Formally, givenT,CF0,CF1, ...,CFT, thenIRRis the solution to the following equation:NPV=CF0+++K+= 0Your task is to find all validIRRs. In this problem, the initial cash-flowCF0 0for alli= 1, 2,...). 阅读全文
posted @ 2013-08-23 22:15 Oyking 阅读(562) 评论(0) 推荐(0) 编辑
摘要: Input: Standard Input Output: Standard Output� There is a rectangle on the cartesian plane, with bottom-left corner at (0,0) and top-right corner at(L,W). There is a ball centered at(x,y), with radius=R, shown belowAt time 0, the ball starts to move along a ray with polar anglea(the angle from posit 阅读全文
posted @ 2013-08-23 21:19 Oyking 阅读(338) 评论(0) 推荐(0) 编辑