摘要: You are givennrods of length 1, 2…, n. You have to pick any 3 of them & build a triangle. How many distinct triangles can you make? Note that, two triangles will be considered different if they have at least 1 pair of arms with different length.InputThe input for each case will have only a singl 阅读全文
posted @ 2014-02-23 23:53 悠悠我心。 阅读(242) 评论(0) 推荐(0)
摘要: Problem AChess QueenInput:Standard InputOutput:Standard OutputYou probably know how the game of chess is played and how chess queen operates. Two chess queens are in attacking position when they are on same row, column or diagonal of a chess board. Suppose two such chess queens (one black and the ot 阅读全文
posted @ 2014-02-23 16:04 悠悠我心。 阅读(279) 评论(0) 推荐(0)
摘要: Once upon a time, in the Kingdom of Loowater, a minor nuisance turned into a major problem.The shores of Rellau Creek in central Loowater had always been a prime breeding ground for geese. Due to the lack of predators, the geese population was out of control. The people of Loowater mostly kept clear 阅读全文
posted @ 2014-02-23 08:43 悠悠我心。 阅读(235) 评论(0) 推荐(0)