上一页 1 2 3 4 5 6 ··· 13 下一页
摘要: Font Size: ← →Problem Description Given a positive integer N, you should output the leftmost digit of N^N. Input The input contains several test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow.Each test case contains a single positive i 阅读全文
posted @ 2012-04-19 22:32 狸の舞 阅读(267) 评论(0) 推荐(0) 编辑
摘要: Font Size: ← →Problem Description这是一个简单的生存游戏,你控制一个机器人从一个棋盘的起始点(1,1)走到棋盘的终点(n,m)。游戏的规则描述如下:1.机器人一开始在棋盘的起始点并有起始点所标有的能量。2.机器人只能向右或者向下走,并且每走一步消耗一单位能量。3.机器人不能在原地停留。4.当机器人选择了一条可行路径后,当他走到这条路径的终点时,他将只有终点所标记的能量。 如上图,机器人一开始在(1,1)点,并拥有4单位能量,蓝色方块表示他所能到达的点,如果他在这次路径选择中选择的终点是(2,4)点,当他到达(2,4)点时将拥有1单位的能量,并开始下一次路径选择. 阅读全文
posted @ 2012-04-19 21:50 狸の舞 阅读(305) 评论(1) 推荐(0) 编辑
摘要: 原文出自:http://zh.wikipedia.org/wiki/%E9%AB%98%E6%96%AF%E6%B6%88%E5%8E%BB%E6%B3%95例子高斯消元法可用来找出下列方程组的解或其解的限制:这个算法的原理是:首先,要将 以下的等式中的 消除,然后再将 以下的等式中的 消除。这样可使整个方程组变成一个三角形似的格式。之后再将已得出的答案一个个地代入已被简化的等式中的未知数中,就可求出其余的答案了。在刚才的例子中,我们将 和相加,就可以将 中的 消除了。然后再将 和相加,就可以将 中的 消除。我们可以这样写:结果就是:现在将 和 相加,就可将 中的 消除:其结果是:这样就完成了 阅读全文
posted @ 2012-04-18 20:26 狸の舞 阅读(445) 评论(0) 推荐(0) 编辑
摘要: 囧,c++已经开了那么久了,从来没练过,一直在搞ACM,今天心血来潮写了个……其实是课程设计的时候无聊搞的#include<iostream>#include<cstdio>#include<cmath>using namespace std;class paopao{public: int x1, x2; void gett(); void putt();};void paopao::gett(){ cin>>x1>>x2;}void paopao::putt(){ cout<<sqrt(x1*x1+x2*x2)< 阅读全文
posted @ 2012-04-17 19:32 狸の舞 阅读(156) 评论(0) 推荐(0) 编辑
摘要: DescriptionBefore ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM). The idea behind is simple. Whenever some ACM member has any small money, he takes all the coins and throws them in 阅读全文
posted @ 2012-03-29 14:00 狸の舞 阅读(275) 评论(0) 推荐(0) 编辑
摘要: DescriptionA palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. You are to write a program which, given a string, determines the minimal number of characters to be inserted into the string in order to obtain a palindrome. As an ex 阅读全文
posted @ 2012-03-29 13:44 狸の舞 阅读(109) 评论(0) 推荐(0) 编辑
摘要: DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = <x1, x2, ..., xm> another sequence Z = <z1, z2, ..., zk> is a subsequence of X if there exists a strictly increasing sequence <i1, i2, ..., ik> of in 阅读全文
posted @ 2012-03-28 22:34 狸の舞 阅读(215) 评论(0) 推荐(0) 编辑
摘要: DescriptionMany years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s , also he went to the grave … The bone collector had a big bag with a volume of V ,and along his trip of collecting there are a lot of bon 阅读全文
posted @ 2012-03-28 22:32 狸の舞 阅读(253) 评论(0) 推荐(0) 编辑
摘要: DescriptionSpeakless 很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用, 这可是很惊人的。Speakless没有多少钱,总共只攒了n万美元。他将在m个学校中选择若干的(当然要在他的经济承受范围内)。每个学校都有不同的申 请费用a(万美元),并且Speakless估计了他得到这个学校offer的可能性b。不同学校之间是否得到offer不会互相影响。“I NEED A OFFER”,他大叫一声。帮帮这个可怜的人吧,帮助他计算一下,他可以收到至少一份offer的最大概率。(如果Speak 阅读全文
posted @ 2012-03-28 22:23 狸の舞 阅读(204) 评论(0) 推荐(0) 编辑
摘要: Description都 说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉, 就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在 小径上接。由于gameboy平时老呆在房间里玩游戏,虽然在游戏中是个身手敏捷的高手,但在现实中运动神经特别迟钝,每秒种只有在移动不超过一米的范围 内接住坠落的馅饼。现在给这条小径如图标上坐标:为了使问题简化,假设在接下来的一段时间里,馅饼都掉落在0-10这11个位置。开始时game 阅读全文
posted @ 2012-03-28 21:58 狸の舞 阅读(145) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 13 下一页