摘要: Problem Description判断两序列是否为同一二叉搜索树序列 Input开始一个数n,(1#include using namespace std;int tr[1024],tr1[1024];//1024的选择要根据元素的个数,极限情况下是所有的节点只有右节点,则节点编号为1->1*2+1(3)->7->15....,每个节点对应一个元素char s[12],s1[12];void insert(int num[],int index,int x)//,数组的编号为树中节点的编号,向二叉树中插入元素{ if(num[index]==-1) num[index]. 阅读全文
posted @ 2014-02-24 16:11 同学少年 阅读(243) 评论(0) 推荐(0)
摘要: Problem DescriptionGive you three sequences of numbers A, B, C, then we give you a number X. Now you need to calculate if you can find the three numbers Ai, Bj, Ck, which satisfy the formula Ai+Bj+Ck = X.InputThere are many cases. Every data case is described as followed: In the first line there are 阅读全文
posted @ 2014-02-24 16:07 同学少年 阅读(172) 评论(0) 推荐(0)
摘要: Problem Description对于输入的每个字符串,查找其中的最大字母,在该字母后面插入字符串“(max)”。Input输入数据包括多个测试实例,每个实例由一行长度不超过100的字符串组成,字符串仅由大小写字母构成。Output对于每个测试实例输出一行字符串,输出的结果是插入字符串“(max)”后的结果,如果存在多个最大的字母,就在每一个最大字母后面都插入"(max)"。Sample InputabcdefgfedcbaxxxxxSample Outputabcdefg(max)fedcbax(max)x(max)x(max)x(max)x(max)Authorlc 阅读全文
posted @ 2014-02-24 15:56 同学少年 阅读(536) 评论(0) 推荐(0)
摘要: Problem Description某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路?Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( #include #include using namespace std;int parent[1002];void init(int n)//初始化{ for(int i=1;i>n&&n) { cin>&g 阅读全文
posted @ 2014-02-24 15:54 同学少年 阅读(1299) 评论(0) 推荐(0)
摘要: Problem DescriptionAs the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the trains in the Ignatius Train Station is the fastest all over the world ^v^). But here comes a problem, there is only one railway where all the 阅读全文
posted @ 2014-02-24 15:46 同学少年 阅读(183) 评论(0) 推荐(0)
摘要: Problem DescriptionThe light travels in a straight line and always goes in the minimal path between two points, are the basic laws of optics.Now, our problem is that, if a branch of light goes into a large and infinite mirror, of course,it will reflect, and leave away the mirror in another direction 阅读全文
posted @ 2014-02-24 15:31 同学少年 阅读(226) 评论(0) 推荐(0)
摘要: Problem Descriptiongameboy是一个CS高手,他最喜欢的就是扮演警察,手持M4爆土匪的头。也许这里有人没玩过CS,有必要介绍一下“爆头”这个术语:所谓爆头,就是子弹直接命中对方的头部,以秒杀敌人。现在用一个三维的直角坐标系来描述游戏中的三维空间(水平面为xoy平面,z轴正方向是上方)。假设游戏中角色的头是一个标准的球。告诉你土匪的身高,头部半径,所站位置的坐标;gameboy所控警察的身高,头部半径,所站位置的坐标,以及枪头所指方向的单位向量。gameboy所控警察所握的是M4,抢瞄准时枪膛中的子弹跟视线基本同线,我们忽略它们的距离,就当成同线。由于土匪手持AK47,所以 阅读全文
posted @ 2014-02-24 15:04 同学少年 阅读(338) 评论(0) 推荐(0)
摘要: Problem DescriptionOnce upon a time there was a greedy King who ordered his chief Architect to build a wall around the King's castle. The King was so greedy, that he would not listen to his Architect's proposals to build a beautiful brick wall with a perfect shape and nice tall towers. Inste 阅读全文
posted @ 2014-02-24 14:58 同学少年 阅读(258) 评论(0) 推荐(0)
摘要: Problem DescriptionMany geometry(几何)problems were designed in the ACM/ICPC. And now, I also prepare a geometry problem for this final exam. According to the experience of many ACMers, geometry problems are always much trouble, but this problem is very easy, after all we are now attending an exam, no 阅读全文
posted @ 2014-02-24 14:51 同学少年 阅读(140) 评论(0) 推荐(0)
摘要: Problem DescriptionThere are many secret openings in the floor which are covered by a big heavy stone. When the stone is lifted up, a special mechanism detects this and activates poisoned arrows that are shot near the opening. The only possibility is to lift the stone very slowly and carefully. The 阅读全文
posted @ 2014-02-24 14:46 同学少年 阅读(245) 评论(0) 推荐(0)
摘要: Cupid's Arrow Time Limit : 3000/1000ms (Java/Other)Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 3Accepted Submission(s) : 2Font: Times New Roman | Verdana | GeorgiaFont Size: ← →Problem Description传说世上有一支丘比特的箭,凡是被这支箭射到的人,就会深深的爱上射箭的人。世上无数人都曾经梦想得到这支箭。Lele当然也不例外。不过他想,在得到这支箭前,他总得先学会 阅读全文
posted @ 2014-02-24 14:39 同学少年 阅读(678) 评论(0) 推荐(0)
摘要: 改革春风吹满地 Time Limit : 2000/1000ms (Java/Other)Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 3Accepted Submission(s) : 3Font: Times New Roman | Verdana | GeorgiaFont Size: ← →Problem Description“ 改革春风吹满地,不会AC没关系;实在不行回老家,还有一亩三分地。谢谢!(乐队奏乐)”话说部分学生心态极好,每天就知道游戏,这次考试如此简单的题目,也是云里雾里,而且,还竟然来这么几 阅读全文
posted @ 2014-02-24 14:34 同学少年 阅读(296) 评论(0) 推荐(0)
摘要: Herding Time Limit : 2000/1000ms (Java/Other)Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 5Accepted Submission(s) : 2Font: Times New Roman | Verdana | GeorgiaFont Size: ← →Problem DescriptionLittle John is herding his father's cattles. As a lazy boy, he cannot tolerate chasing t 阅读全文
posted @ 2014-02-24 14:19 同学少年 阅读(239) 评论(0) 推荐(0)