摘要: Problem DescriptionGardon的18岁生日就要到了,他当然很开心,可是他突然想到一个问题,是不是每个人从出生开始,到达18岁生日时所经过的天数都是一样的呢?似乎并不全都是这样,所以他想请你帮忙计算一下他和他的几个朋友从出生到达18岁生日所经过的总天数,让他好来比较一下。Input一个数T,后面T行每行有一个日期,格式是YYYY-MM-DD。如我的生日是1988-03-07。OutputSample Input11988-03-07Sample Output6574AuthorGardonSourceGardon-DYGG Contest 2解题思路:如下代码代码:#incl 阅读全文
posted @ 2013-09-01 13:34 同学少年 阅读(325) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionHOHO,终于从Speakless手上赢走了所有的糖果,是Gardon吃糖果时有个特殊的癖好,就是不喜欢将一样的糖果放在一起吃,喜欢先吃一种,下一次吃另一种,这样;可是Gardon不知道是否存在一种吃糖果的顺序使得他能把所有糖果都吃完?请你写个程序帮忙计算一下。Input第一行有一个整数T,接下来T组数据,每组数据占2行,第一行是一个整数N(0using namespace std;int kind[1000005];int main(){ int t; //t组数据 int n; //n种类 cin>>t; int i,j; ... 阅读全文
posted @ 2013-09-01 13:14 同学少年 阅读(951) 评论(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 @ 2013-09-01 13:04 同学少年 阅读(189) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionThe highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator up one floor, and 4 seconds to move down one floor. The 阅读全文
posted @ 2013-09-01 12:55 同学少年 阅读(218) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionA number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are to calculate the value of f(n).InputThe input consists of multiple test cases. Each test case contains 3 integers A, B and n on a single line (1 using 阅读全文
posted @ 2013-09-01 12:48 同学少年 阅读(261) 评论(0) 推荐(0) 编辑
摘要: 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 @ 2013-09-01 12:28 同学少年 阅读(138) 评论(0) 推荐(0) 编辑