觉得浮夸了四年,漠然发现原来是浮躁了四年!

上一页 1 ··· 3 4 5 6 7 8 下一页
摘要: The usage of getline();#include<iostream>#include<map>#include<string>using namespace std;int main(){ int n; cin>>n; int p=1; while(n--) { int num; string str; cin>>num; getchar(); getline(cin,str); int m; int a[600]; cin... 阅读全文
posted @ 2012-12-29 15:21 heat nan 阅读(140) 评论(0) 推荐(0)
摘要: Problem link adress:click hereThis isabasic BFS problem.But the way of knight'smove is strange,if you don't know the law of the knight's move,you are likely to cann't work the problem out.However,if you can find the regularity of the problem from the given cases's data,you must b 阅读全文
posted @ 2012-12-22 22:55 heat nan 阅读(276) 评论(0) 推荐(0)
摘要: Problem link adress :hdu 4460Problem analysis:For this problem,first give you some people's name and then give you the relations of them.Now,you task is calculate the maximum steps between the every two guys.To solve the problem,you just need to calculate all the steps between the every two guys 阅读全文
posted @ 2012-12-19 18:58 heat nan 阅读(265) 评论(0) 推荐(0)
摘要: A very hard Aoshu problemProblem DescriptionAoshu is very popular among primary school students. It is mathematics, but much harder than ordinary mathematics for primary school students. Teacher Liu is an Aoshu teacher. He just comes out with a problem to test his students: Given a serial of digits, 阅读全文
posted @ 2012-12-18 22:51 heat nan 阅读(228) 评论(0) 推荐(0)
摘要: R(N)Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1458 Accepted Submission(s): 762 Problem DescriptionWe know that some positive integer x can be expressed as x=A^2+B^2(A,B are integers). Take x=10 for example, 10=(-3)^2+1^2. We define R(N) (N 阅读全文
posted @ 2012-12-01 14:16 heat nan 阅读(237) 评论(0) 推荐(0)
摘要: 约瑟夫问题:标号从1到n的n个人围成一个圈,从1开始计数到m的人退出圈子,然后从退出的下一个人开始接着从1计数,数到m的人后继续退出,最后只剩下一个人,求剩下人的编号。这便是约瑟夫问题的模型。约瑟夫问题分析:约瑟夫问题是一道典型的模拟问题。如果采用一般的方法模拟难度较大,代码也较长。采用链表的方法可以使问题更加容易解决。链表是一种基于指针运用的数据结构。对于初学者或者指针运用不熟练的来说实现链表模拟比较困难。本人green hand,参考Robert Sedgewick大牛的代码作此篇文章,以实现链表解决约瑟夫问题,同时对链表做一些介绍。code:#include<stdio.h> 阅读全文
posted @ 2012-11-22 22:22 heat nan 阅读(2923) 评论(0) 推荐(0)
摘要: problem link address :http://acm.hdu.edu.cn/showproblem.php?pid=2199在顺序搜索的数组实现中,如果把分治思想思想应用于搜索过程,就会大大缩短搜索的总时间。实现方法:把数据分为两部分,确定搜索关键字属于那一部分然后集中搜索这一部分,然后依次类推,每次把处理的部分分为两部分,因此,这种方法称为“二分法”。关于本题:典型的二分查找。应为本题有明显的特征: 查找范围0~100,并且有唯一解。 Code 1 #include<iostream> 2 #include<cmath> 3 using namespace 阅读全文
posted @ 2012-11-22 17:56 heat nan 阅读(141) 评论(0) 推荐(0)
摘要: Problem DescriptionNo matter you know me or not. Bless you happy in 2009.InputThe input contains multiple test cases.Each test case included one string. There are made up of ‘a’-‘z’ or blank. The length of string will not large than 10000. OutputFor each test case tell me how many times “happy” can 阅读全文
posted @ 2012-11-10 17:28 heat nan 阅读(157) 评论(0) 推荐(0)
摘要: Problem webpage:http://acm.hdu.edu.cn/showproblem.php?pid=4461Problem analysis:This is one of the 2012 Asia Hangzhou Regional Contest problems, what I want to say is this problem is just proved that you joined the contest;The only problem is the problem description is too long>After reading the p 阅读全文
posted @ 2012-11-09 19:20 heat nan 阅读(111) 评论(0) 推荐(0)
摘要: Problem DescriptionIn China, foreign brand commodities are often much more expensive than abroad. The main reason is that we Chinese people tend to think foreign things are better and we are willing to pay much for them. The typical example is, on the United Airline flight, they give you Haagendazs 阅读全文
posted @ 2012-11-09 13:16 heat nan 阅读(152) 评论(0) 推荐(0)
摘要: Problem DescriptionWangpeng has N clothes, M pants and K shoes so theoretically he can have N×M×K different combinations of dressing.One day he wears his pants Nike, shoes Adiwang to go to school happily. When he opens the door, his mom asks him to come back and switch the dressing. Mom th 阅读全文
posted @ 2012-11-04 19:54 heat nan 阅读(151) 评论(0) 推荐(0)
摘要: Problem DescriptionA while ago I had trouble sleeping. I used to lie awake, staring at the ceiling, for hours and hours. Then one day my grandmother suggested I tried counting sheep after I'd gone to bed. As always when my grandmother suggests things, I decided to try it out. The only problem wa 阅读全文
posted @ 2012-11-03 15:11 heat nan 阅读(193) 评论(0) 推荐(0)
摘要: Problem DescriptionNew Year is Coming! ailyanlu is very happy today! and he is playing a chessboard game with 8600. The size of the chessboard is n*n. A stone is placed in a corner square. They play alternatively with 8600 having the first move. Each time, player is allowed to move the stone to an u 阅读全文
posted @ 2012-11-03 10:12 heat nan 阅读(232) 评论(0) 推荐(0)
摘要: Problem DescriptionAlice and Bob are the topmost hunters in the forest, so no preys can escape from them. However, they both think that its hunting skill is better than the other. So they need a match.In their match, the targets are two animals, a tiger and a wolf. They both know that the tiger is l 阅读全文
posted @ 2012-11-02 23:53 heat nan 阅读(152) 评论(0) 推荐(0)
摘要: Problem DescriptionWangpeng is good at drawing. Now he wants to say numbers like “521” to his girlfriend through the game draw something.Wangpeng can’t write the digit directly. So he comes up a way that drawing several squares and the total area of squares is the number he wants to say.Input all th 阅读全文
posted @ 2012-11-02 12:52 heat nan 阅读(174) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 下一页