![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Tsinghua mooc
文章平均质量分 70
Dreamoon5
Hello world!
展开
-
Tsinghua mooc 数据结构上 范围查询(Range) 快排+二分
先补一波mooc上数据结构的题,题面如下: Descriptioin Let S be a set of n integral points on the x-axis. For each given interval [a, b], you are asked to count the points lying inside.Input The first line contains ...原创 2018-09-09 20:53:38 · 1342 阅读 · 0 评论 -
Tsinghua mooc 数据结构上 祖玛(Zuma) List
Description Let’s play the game Zuma!There are a sequence of beads on a track at the right beginning. All the beads are colored but no three adjacent ones are allowed to be with a same color. You c...原创 2018-09-09 21:08:56 · 788 阅读 · 0 评论 -
Tsinghua mooc 数据结构上 灯塔(LightHouse) 归并排序
描述 海上有许多灯塔,为过路船只照明。每个灯塔都配有一盏探照灯,照亮其东北、西南两个对顶的直角区域。探照灯的功率之大,足以覆盖任何距离。灯塔本身是如此之小,可以假定它们不会彼此遮挡。若灯塔A、B均在对方的照亮范围内,则称它们能够照亮彼此。现在,对于任何一组给定的灯塔,请计算出其中有多少对灯塔能够照亮彼此。 输入 共n+1行。 第1行为1个整数n,表示灯塔的总数。 第2到n+1...原创 2018-09-09 21:32:36 · 1066 阅读 · 0 评论 -
Tsinghua mooc 数据结构上 列车调度(Train) 栈混洗
描述 某列车调度站的铁道联接结构如Figure 1所示。其中,A为入口,B为出口,S为中转盲端。所有铁道均为单轨单向式:列车行驶的方向只能是从A到S,再从S到B;另外,不允许超车。因为车厢可在S中驻留,所以它们从B端驶出的次序,可能与从A端驶入的次序不同。不过S的容量有限,同时驻留的车厢不得超过m节。设某列车由编号依次为{1, 2, …, n}的n节车厢组成。调度员希望知道,按照以上交通...原创 2018-09-12 21:33:11 · 1554 阅读 · 2 评论