code for fun

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2014年2月28日

摘要: Problem DescriptionContest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popular problem. When the contest is over, they will count the balloons of each color and find the result.This year, they decide to l 阅读全文
posted @ 2014-02-28 17:11 xueda120 阅读(197) 评论(0) 推荐(0) 编辑

摘要: Problem DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 + 4 = 14.InputThe first line of the input contains an integer T(1#includeusing namespace std;void solve 阅读全文
posted @ 2014-02-28 16:29 xueda120 阅读(162) 评论(0) 推荐(0) 编辑

摘要: Problem DescriptionA simple mathematical formula for e iswhere n is allowed to go to infinity. This can actually yield very accurate approximations of e using relatively small values of n.OutputOutput the approximations of e generated by the above formula for the values of n from 0 to 9. The beginni 阅读全文
posted @ 2014-02-28 11:41 xueda120 阅读(199) 评论(0) 推荐(0) 编辑