摘要: 在包含里面加上#include<stdlib.h>然后调用system("color 3f");颜色属性由两个十六进制数字指定 -- 第一个为背景,第二个则为前景。每个数字可以为以下任何值之一: 0 = 黑色 8 = 灰色 1 = 蓝色 9 = 淡蓝色 2 = 绿色 A = 淡绿色 3 = 湖蓝色 B = 淡浅绿色 4 = 红色 C = 淡红色 5 = 紫色 D = 淡紫色 6 = 黄色 E = 淡黄色 7 = 白色 F = 亮白色1.设置控制台输出行数和... 阅读全文
posted @ 2012-12-08 09:25 forevermemory 阅读(1287) 评论(0) 推荐(0) 编辑
摘要: Problem Description在金融中,我们有时会用内部收益率IRR来评价项目的投资财务效益,它等于使得投资净现值NPV等于0的贴现率。换句话说,给定项目的期数T、初始现金流CF0和项目各期的现金流CF1, CF2, ...,CFT,IRR是下面方程的解:NPV=CF0+CF1/(1+IRR)+CF2/(1+IRR)^2+...+CFT/(1+IRR)^T=0为了简单起见,本题假定:除了项目启动时有一笔投入(即初始现金流CF0 < 0)之外,其余各期均能赚钱(即对于所有i=1,2,...,T,CFi > 0)。根据定义,IRR可以是负数,但不能大于-1。Input输入文件最 阅读全文
posted @ 2012-12-05 20:26 forevermemory 阅读(540) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionMy birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my party and each of them gets a piece of pie. This should be one piece of one pie, not several sm 阅读全文
posted @ 2012-12-05 17:42 forevermemory 阅读(167) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionAndy和Mary养了很多猪。他们想要给猪安家。但是Andy没有足够的猪圈,很多猪只能够在一个猪圈安家。举个例子,假如有16头猪,Andy建了3个猪圈,为了保证公平,剩下1头猪就没有地方安家了。Mary生气了,骂Andy没有脑子,并让他重新建立猪圈。这回Andy建造了5个猪圈,但是仍然有1头猪没有地方去,然后Andy又建造了7个猪圈,但是还有2头没有地方去。Andy都快疯了。你对这个事情感兴趣起来,你想通过Andy建造猪圈的过程,知道Andy家至少养了多少头猪。 Input输入包含多组测试数据。每组数据第一行包含一个整数n (n <= 10) – A 阅读全文
posted @ 2012-12-05 00:14 forevermemory 阅读(170) 评论(0) 推荐(0) 编辑
摘要: DescriptionIn the 17th century, with thunderous noise, dense smoke and blazing fire, battles on the sea were just the same as those in the modern times. But at that time, the cannon ,were extremely simple. It was just like an iron cylinder, with its rearward end sealed and forward end open. There wa 阅读全文
posted @ 2012-12-04 00:24 forevermemory 阅读(222) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionNow, here is a fuction:F(x) = 6 * x^7+8*x^6+7*x^3+5*x^2-y*x (0 <= x <=100)Can you find the minimum value when x is between 0 and 100. InputThe first line of the input contains an integer T(1<=T<=100) which means the number of test cases. Then T lines follow, each line 阅读全文
posted @ 2012-12-02 22:32 forevermemory 阅读(109) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionNow,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y,can you find its solution between 0 and 100;Now please try your lucky. InputThe first line of the input contains an integer T(1<=T<=100) which means the number of test cases. Then T lines follow, each line has a rea 阅读全文
posted @ 2012-12-02 00:36 forevermemory 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Problem Description在给出的数列中(数列中没有重复元素),判断某个元素存在与否。 Input输入的第1行为示例个数T,对于每个示例第1行为n(n<1000000),表示输入数列中元素的个数,下面1行为n个元素,第3行为查询元素的个数m(m<15000),下面m行为每个需要查询的元素。 Output输出每个需要查询元素的查询结果,如果查找到输出"Yes",否则输出"No"。 Sample Input151 4 5 2 3237Sample OutputYesNo#include<iostream>#include& 阅读全文
posted @ 2012-12-01 23:57 forevermemory 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 汉诺塔I Time Limit : 3000/1000ms (Java/Other)Memory Limit : 65535/32768K (Java/Other)Total Submission(s) : 44Accepted Submission(s) : 17Font: Times New Roman | Verdana | Georgia Font Size: ← →Problem Description设a,b,c是3个塔座。开始时,在塔座a上有一叠共n个圆盘,这些圆盘自下而上,由大到小地叠在一起。各圆盘从小到大编号为1,2,…,n,现要求塔座a上的这一叠圆盘移到塔座c上,并仍按原来 阅读全文
posted @ 2012-11-30 11:41 forevermemory 阅读(306) 评论(0) 推荐(0) 编辑
摘要: Problem I Time Limit : 3000/1000ms (Java/Other)Memory Limit : 65535/32768K (Java/Other)Total Submission(s) : 3Accepted Submission(s) : 3Font: Times New Roman | Verdana | Georgia Font Size: ← →Problem Description最近ZC对素数的一些变换十分感兴趣,于是自定义了一款素数变换游戏。游戏规则如下:1.随机给你a,b两个素数,问由a变换到b的最少步数。2.规定每次只能变素数的一个数位。3.规定每 阅读全文
posted @ 2012-11-25 17:31 forevermemory 阅读(325) 评论(0) 推荐(0) 编辑