摘要: Benny has a spacious farm land to irrigate. The farm land is a rectangle, and is divided into a lot of samll squares. Water pipes are placed in these 阅读全文
posted @ 2019-11-20 11:19 杰瑞与汤姆 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 有一天,索菲亚(Sophia)找到了一个很大的广场。广场上有n棵树。他们都很高。索菲娅对他们非常有趣。 她发现树可能不和谐,并且两棵树之间的不和谐值与两个值FAR和SHORT相关联。FAR的定义如下:如果我们将所有这些树按照它们的X坐标按升序排列,则X坐标最小的树排名第一,X坐标相同的树排名相同。例 阅读全文
posted @ 2019-11-19 23:25 杰瑞与汤姆 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Five hundred years later, the number of dragon balls will increase unexpectedly, so it's too difficult for Monkey King(WuKong) to gather all of the dr 阅读全文
posted @ 2019-11-19 21:21 杰瑞与汤姆 阅读(120) 评论(0) 推荐(0) 编辑
摘要: The order of a Tree Problem Description As we know,the shape of a binary search tree is greatly related to the order of keys we insert. To be precisel 阅读全文
posted @ 2019-09-14 12:57 杰瑞与汤姆 阅读(387) 评论(0) 推荐(0) 编辑
摘要: Binary Tree Traversals Problem Description A binary tree is a finite set of vertices that is either empty or consists of a root r and two disjoint bin 阅读全文
posted @ 2019-09-13 15:45 杰瑞与汤姆 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 连连看 Problem Description “连连看”相信很多人都玩过。没玩过也没关系,下面我给大家介绍一下游戏规则:在一个棋盘中,放了很多的棋子。如果某两个相同的棋子,可以通过一条线连起来(这条线不能经过其它棋子),而且线的转折次数不超过两次,那么这两个棋子就可以在棋盘上消去。不好意思,由于我 阅读全文
posted @ 2019-09-13 15:41 杰瑞与汤姆 阅读(129) 评论(0) 推荐(0) 编辑
摘要: N皇后问题 Problem Description 在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。你的任务是,对于给定的N,求出有多少种合法的放置方法。 Input 共有若干行,每行一个正整数N≤10,表示棋盘和 阅读全文
posted @ 2019-09-13 15:13 杰瑞与汤姆 阅读(144) 评论(0) 推荐(0) 编辑
摘要: list 用法 1.构造函数和析构函数 list<TYPE> c 产生一个空list,没有任何元素 list<TYPE> c1(c2) 产生一个与c2同型的list list<TYPE> c(n) 产生一个拥有n个元素的list list<TYPE> c(n,value) 产生一个拥有n个元素且值为 阅读全文
posted @ 2019-09-10 21:35 杰瑞与汤姆 阅读(175) 评论(0) 推荐(0) 编辑
摘要: Problem Description 看病要排队这个是地球人都知道的常识。不过经过细心的0068的观察,他发现了医院里排队还是有讲究的。0068所去的医院有三个医生(汗,这么少)同时看病。而看病的人病情有轻重,所以不能根据简单的先来先服务的原则。所以医院对每种病情规定了10种不同的优先级。级别为1 阅读全文
posted @ 2019-09-10 21:19 杰瑞与汤姆 阅读(114) 评论(0) 推荐(0) 编辑
摘要: Description A Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting several places numbered by integers from 阅读全文
posted @ 2019-08-22 10:15 杰瑞与汤姆 阅读(155) 评论(0) 推荐(0) 编辑