上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 17 下一页
摘要: DescriptionIn 1742, Christian Goldbach, a German amateur mathematician, sent a letter to Leonhard Euler in which he made the following conjecture:Every even number greater than 4 can bewritten as the sum of two odd prime numbers.For example:8 = 3 + 5. Both 3 and 5 are odd prime numbers.20 = 3 + 17 = 阅读全文
posted @ 2012-04-06 16:55 'wind 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 要求: 输入正整数n,(2<=n<=100)把阶乘分解成素数因子相乘的形式,从小到大输出各个素数的指数。sample input:523sample output:5!=3 1 153!=49 23 12 8 4 4 3 2 2 1 1 1 1 1 1 1code:View Code #include<stdio.h>#include<string.h>//素数判定int isprime(int n){ if(i%2==0&&i!=2) return 0;for(i=2;i*i<=n;i++) if(n%i==0) return 0; 阅读全文
posted @ 2012-04-06 16:53 'wind 阅读(220) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionThe digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resulting value contains two or more digits, those digits are summed and the process is repeated. This is cont 阅读全文
posted @ 2012-04-06 16:51 'wind 阅读(178) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionIgnatius is poor at math,he falls across a puzzle problem,so he has no choice but to appeal to Eddy. this problem describes that:f(x)=5*x^13+13*x^5+k*a*x,input a nonegative integer k(k<10000),to find the minimal nonegative integer a,make the arbitrary integer x ,65|f(x)ifno exi 阅读全文
posted @ 2012-04-06 16:49 'wind 阅读(206) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionWe all know that Bin-Laden is a notorious terrorist, and he has disappeared for a long time. But recently, it is reported that he hides in Hang Zhou of China! “Oh, God! How terrible! ”Don’t be so afraid, guys. Although he hides in a cave of Hang Zhou, he dares not to go out. Laden 阅读全文
posted @ 2012-04-06 16:47 'wind 阅读(156) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionPeople in Silverland use square coins. Not only they have square shapes but also their values are square numbers. Coins with values of all square numbers up to 289 (=17^2), i.e., 1-credit coins, 4-credit coins, 9-credit coins, ..., and 289-credit coins, are available in Silverland 阅读全文
posted @ 2012-04-06 16:46 'wind 阅读(168) 评论(0) 推荐(0) 编辑
摘要: Problem Description"Well, it seems the first problem is too easy. I will let you know how foolish you are later." feng5166 says."The second problem is, given an positive integer N, we define an equation like this:N=a[1]+a[2]+a[3]+...+a[m];a[i]>0,1<=m<=N;My question is how man 阅读全文
posted @ 2012-04-06 16:44 'wind 阅读(178) 评论(0) 推荐(0) 编辑
摘要: Problem Description1,2,...,n表示n个盘子.数字大盘子就大.n个盘子放在第1根柱子上.大盘不能放在小盘上.在第1根柱子上的盘子是a[1],a[2],...,a[n]. a[1]=n,a[2]=n-1,...,a[n]=1.即a[1]是最下面的盘子.把n个盘子移动到第3根柱子.每次只能移动1个盘子,且大盘不能放在小盘上.问第m次移动的是那一个盘子.Input每行2个整数n (1 ≤ n ≤ 63) ,m≤ 2^n-1.n=m=0退出Output输出第m次移动的盘子的号数.Sample Input63 1 63 2 0 0Sample Output1 2分析:从 移动看出 阅读全文
posted @ 2012-04-06 16:42 'wind 阅读(201) 评论(0) 推荐(0) 编辑
摘要: Problem Description据说在很久很久以前,可怜的兔子经历了人生中最大的打击——赛跑输给乌龟后,心中郁闷,发誓要报仇雪恨,于是躲进了杭州下沙某农业园卧薪尝胆潜心修炼,终于练成了绝技,能够毫不休息得以恒定的速度(VR m/s)一直跑。兔子一直想找机会好好得教训一下乌龟,以雪前耻。最近正值HDU举办50周年校庆,社会各大名流齐聚下沙,兔子也趁此机会向乌龟发起挑战。虽然乌龟深知获胜希望不大,不过迫于舆论压力,只能接受挑战。比赛是设在一条笔直的道路上,长度为L米,规则很简单,谁先到达终点谁就算获胜。无奈乌龟自从上次获胜以后,成了名龟,被一些八卦杂志称为“动物界的刘翔”,广告不断,手头也有 阅读全文
posted @ 2012-04-06 00:13 'wind 阅读(227) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionAs we know, Big Number is always troublesome. But it's really important in our ACM. And today, your task is to write a program to calculate A mod B.To make the problem easier, I promise that B will be smaller than 100000.Is it too hard? No, I work it out in 10 minutes, and my 阅读全文
posted @ 2012-04-05 21:14 'wind 阅读(200) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionThere are many students in PHT School. One day, the headmaster whose name is PigHeader wanted all students stand in a line. He prescribed that girl can not be in single. In other words, either no girl in the queue or more than one girl stands side by side. The case n=4 (n is the n 阅读全文
posted @ 2012-04-05 20:41 'wind 阅读(244) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionIn a Lotto I have ever played, one has to select 6 numbers from the set {1,2,...,49}. A popular strategy to play Lotto - although it doesn't increase your chance of winning - is to select a subset S containing k (k>6) of these 49 numbers, and then play several games with ch 阅读全文
posted @ 2012-04-05 17:31 'wind 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionThe Really Neato Calculator Company, Inc. has recently hired your team to help design their Super Neato Model I calculator. As a computer scientist you suggested to the company that it would be neato if this new calculator could convert among number bases. The company thought this 阅读全文
posted @ 2012-04-05 16:41 'wind 阅读(205) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionThe annual Games in frogs' kingdom started again. The most famous game is the Ironfrog Triathlon. One test in the Ironfrog Triathlon is jumping. This project requires the frog athletes to jump over the river. The width of the river is L (1<= L <= 1000000000). There are n 阅读全文
posted @ 2012-04-05 00:27 'wind 阅读(228) 评论(0) 推荐(0) 编辑
摘要: DescriptionA TV-network plans to broadcast an important football match. Their network of transmitters and users can be represented as a tree. The root of the tree is a transmitter that emits the football match, the leaves of the tree are the potential users and other vertices in the tree are relays 阅读全文
posted @ 2012-04-04 17:35 'wind 阅读(396) 评论(0) 推荐(0) 编辑
摘要: 题意:有 n个人想移居到m 个星球,知道了每个人可以移居前往的星球和每个星球的人口容量,问是否所有人都能够成功迁移。分析: 二分图多重匹配。View Code #include<stdio.h>#include<string.h>int cap[12]; //cap[i] 表示i点的匹配上限 int map[100002][12];int vlink[12]; //vlink[i] 表示i点当前的匹配数 int link[12][100002]; //li... 阅读全文
posted @ 2012-04-03 10:30 'wind 阅读(237) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionWhile studying the history of royal families, you want to know how wealthy each family is. While you have various 'net worth' figures for each individual throughout history, this is complicated by double counting caused by inheritance. One way to estimate the wealth of a f 阅读全文
posted @ 2012-04-02 23:38 'wind 阅读(404) 评论(0) 推荐(0) 编辑
摘要: DescriptionBob enjoys playing computer games, especially strategic games, but sometimes he cannot find the solution fast enough and then he is very sad. Now he has the following problem. He must defend a medieval city, the roads of which form a tree. He has to put the minimum number of soldiers on t 阅读全文
posted @ 2012-04-02 16:38 'wind 阅读(512) 评论(0) 推荐(0) 编辑
摘要: DescriptionLet us define a regular brackets sequence in the following way: 1. Empty sequence is a regular sequence. 2. If S is a regular sequence, then (S) and [S] are both regular sequences. 3. If A and B are regular sequences, then AB is a regular sequence. For example, all of the following sequen 阅读全文
posted @ 2012-04-01 21:10 'wind 阅读(299) 评论(0) 推荐(0) 编辑
摘要: Recently, researchers on Mars have discovered N powerful atoms. All of them are different. These atoms have some properties. When two of these atoms collide, one of them disappears and a lot of power is produced. Researchers know the way every two atoms perform when collided and the power every two 阅读全文
posted @ 2012-04-01 20:03 'wind 阅读(420) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionThere are N cities in the country. Each city is represent by a matrix size of M*M. If city A, B and C satisfy that A*B = C, we say that there is a road from A to C with distance 1 (but that does not means there is a road from C to A).Now the king of the country wants to ask me som 阅读全文
posted @ 2012-04-01 16:38 'wind 阅读(439) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionAfter coding so many days,Mr Acmer wants to have a good rest.So travelling is the best choice!He has decided to visit n cities(he insists on seeing all the cities!And he does not mind which city being his start station because superman can bring him to any city at first but only o 阅读全文
posted @ 2012-04-01 11:21 'wind 阅读(567) 评论(0) 推荐(0) 编辑
摘要: DescriptionThe Pizazz Pizzeria prides itself in delivering pizzas to its customers as fast as possible. Unfortunately, due to cutbacks, they can afford to hire only one driver to do the deliveries. He will wait for 1 or more (up to 10) orders to be processed before he starts any deliveries. Needless 阅读全文
posted @ 2012-03-31 19:45 'wind 阅读(602) 评论(0) 推荐(0) 编辑
摘要: DescriptionFarmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy corn for the cows on a number of squares. Regrettably, some of the squares are infertile and can't be planted. Canny FJ knows that the cows 阅读全文
posted @ 2012-03-30 21:51 'wind 阅读(343) 评论(0) 推荐(0) 编辑
摘要: Problem Description小t非常感谢大家帮忙解决了他的上一个问题。然而病毒侵袭持续中。在小t的不懈努力下,他发现了网路中的“万恶之源”。这是一个庞大的病毒网站,他有着好多好多的病毒,但是这个网站包含的病毒很奇怪,这些病毒的特征码很短,而且只包含“英文大写字符”。当然小t好想好想为民除害,但是小t从来不打没有准备的战争。知己知彼,百战不殆,小t首先要做的是知道这个病毒网站特征:包含多少不同的病毒,每种病毒出现了多少次。大家能再帮帮他吗?Input第一行,一个整数N(1<=N<=1000),表示病毒特征码的个数。接下来N行,每行表示一个病毒特征码,特征码字符串长度在1—5 阅读全文
posted @ 2012-03-30 19:05 'wind 阅读(228) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionHow can anagrams result from sequences of stack operations? There are two sequences of stack operators which can convert TROT to TORT: [i i i i o o o oi o i i o o i o]where i stands for Push and o stands for Pop. Your program should, given pairs of words produce sequences of stack 阅读全文
posted @ 2012-03-30 17:30 'wind 阅读(206) 评论(0) 推荐(0) 编辑
摘要: Problem Description当太阳的光辉逐渐被月亮遮蔽,世界失去了光明,大地迎来最黑暗的时刻。。。。在这样的时刻,人们却异常兴奋——我们能在有生之年看到500年一遇的世界奇观,那是多么幸福的事儿啊~~但网路上总有那么些网站,开始借着民众的好奇心,打着介绍日食的旗号,大肆传播病毒。小t不幸成为受害者之一。小t如此生气,他决定要把世界上所有带病毒的网站都找出来。当然,谁都知道这是不可能的。小t却执意要完成这不能的任务,他说:“子子孙孙无穷匮也!”(愚公后继有人了)。万事开头难,小t收集了好多病毒的特征码,又收集了一批诡异网站的源码,他想知道这些网站中哪些是有病毒的,又是带了怎样的病毒呢? 阅读全文
posted @ 2012-03-29 23:09 'wind 阅读(228) 评论(0) 推荐(0) 编辑
摘要: DescriptionGiven a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let's say the phone catalogue listed these numbers:Emergency 911Alice 97 625 999Bob 91 12 54 26In this case, it's not possible to call Bob, because the central would 阅读全文
posted @ 2012-03-29 21:01 'wind 阅读(151) 评论(0) 推荐(0) 编辑
摘要: Problem Description我们大家经常用google检索信息,但是检索信息的程序是很困难编写的;现在请你编写一个简单的全文检索程序。问题的描述是这样的:给定一个信息流文件,信息完全有数字组成,数字个数不超过60000个,但也不少于60个;再给定一个关键字集合,其中关键字个数不超过10000个,每个关键字的信息数字不超过60个,但也不少于5个;两个不同的关键字的前4个数字是不相同的;由于流文件太长,已经把它分成多行;请你编写一个程序检索出有那些关键字在文件中出现过。Input第一行是两个整数M,N;M表示数字信息的行数,N表示关键字的个数;接着是M行信息数字,然后是一个空行;再接着是 阅读全文
posted @ 2012-03-29 14:07 'wind 阅读(223) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionIn the modern time, Search engine came into the life of everybody like Google, Baidu, etc.Wiskey also wants to bring this feature to his image retrieval system.Every image have a long description, when users type some keywords to find the image, the system will match the keywords 阅读全文
posted @ 2012-03-28 13:02 'wind 阅读(281) 评论(0) 推荐(1) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 17 下一页