上一页 1 ··· 8 9 10 11 12 13 14 15 下一页

2018年3月5日

HDU 3342 Legal or Not(拓扑排序)

摘要: 描述 ACM-DIY is a large QQ group where many excellent acmers get together. It is so harmonious that just like a big family. Every day,many "holy cows" l 阅读全文

posted @ 2018-03-05 11:18 大桃桃 阅读(180) 评论(0) 推荐(0)

2018年3月4日

POJ 3169 Layout(差分约束+链式前向星+SPFA)

摘要: 描述 Like everyone else, cows like to stand close to their friends when queuing for feed. FJ has N (2 <= N <= 1,000) cows numbered 1..N standing along a 阅读全文

posted @ 2018-03-04 21:22 大桃桃 阅读(232) 评论(0) 推荐(1)

2018年3月3日

HDU 2680 Choose the best route(SPFA)

摘要: Problem DescriptionOne day , Kiki wants to visit one of her friends. As she is liable to carsickness , she wants to arrive at her friend’s home as soo 阅读全文

posted @ 2018-03-03 20:15 大桃桃 阅读(172) 评论(0) 推荐(1)

2018年3月1日

PAT L2-016 愿天下有情人都是失散多年的兄妹(深搜)

摘要: 呵呵。大家都知道五服以内不得通婚,即两个人最近的共同祖先如果在五代以内(即本人、父母、祖父母、曾祖父母、高祖父母)则不可通婚。本题就请你帮助一对有情人判断一下,他们究竟是否可以成婚? 输入格式: 输入第一行给出一个正整数N(2 <= N <= 104),随后N行,每行按以下格式给出一个人的信息: 本 阅读全文

posted @ 2018-03-01 00:19 大桃桃 阅读(616) 评论(0) 推荐(1)

2018年2月28日

PAT L2-013 红色警报(并查集求连通子图)

摘要: 战争中保持各个城市间的连通性非常重要。本题要求你编写一个报警程序,当失去一个城市导致国家被分裂为多个无法连通的区域时,就发出红色警报。注意:若该国本来就不完全连通,是分裂的k个区域,而失去一个城市并不改变其他城市之间的连通性,则不要发出警报。 输入格式: 输入在第一行给出两个整数N(0 < N <= 阅读全文

posted @ 2018-02-28 22:39 大桃桃 阅读(478) 评论(0) 推荐(1)

PAT L2-014 列车调度(最长上升nlogn)

摘要: 火车站的列车调度铁轨的结构如下图所示。 两端分别是一条入口(Entrance)轨道和一条出口(Exit)轨道,它们之间有N条平行的轨道。每趟列车从入口可以选择任意一条轨道进入,最后从出口离开。在图中有9趟列车,在入口处按照{8,4,2,5,3,9,1,6,7}的顺序排队等待进入。如果要求它们必须按序 阅读全文

posted @ 2018-02-28 21:33 大桃桃 阅读(253) 评论(0) 推荐(1)

PAT L3-010 是否完全二叉搜索树(二叉搜索树)

摘要: 将一系列给定数字顺序插入一个初始为空的二叉搜索树(定义为左子树键值大,右子树键值小),你需要判断最后的树是否一棵完全二叉树,并且给出其层序遍历的结果。 输入格式: 输入第一行给出一个不超过20的正整数N;第二行给出N个互不相同的正整数,其间以空格分隔。 输出格式: 将输入的N个正整数顺序插入一个初始 阅读全文

posted @ 2018-02-28 20:58 大桃桃 阅读(204) 评论(0) 推荐(1)

2018年2月27日

HRBUST 2310 Tree Painting(无向图欧拉路径的性质)

摘要: Give you a tree, can you draw the tree with minimum strokes without overlapping? Noted that it is ok if two strokes intersect at one point. Here we de 阅读全文

posted @ 2018-02-27 22:49 大桃桃 阅读(194) 评论(0) 推荐(0)

POJ 2230 Watchcow(有向图欧拉回路)

摘要: Bessie's been appointed the new watch-cow for the farm. Every night, it's her job to walk across the farm and make sure that no evildoers are doing an 阅读全文

posted @ 2018-02-27 21:54 大桃桃 阅读(189) 评论(0) 推荐(0)

UVa 10054 The Necklace(无向图欧拉回路)

摘要: My little sister had a beautiful necklace made of colorful beads. Two successive beads in the necklace shared a common color at their meeting point. T 阅读全文

posted @ 2018-02-27 20:15 大桃桃 阅读(189) 评论(0) 推荐(0)

2018年2月26日

UVa 1600 Patrol Robot(三维广搜)

摘要: A robot has to patrol around a rectangular area which is in a form of m x n grid (m rows and ncolumns). The rows are labeled from 1 to m. The columns 阅读全文

posted @ 2018-02-26 23:34 大桃桃 阅读(164) 评论(0) 推荐(0)

UVa 536 Tree Recovery(二叉树后序遍历)

摘要: Little Valentine liked playing with binary trees very much. Her favorite game was constructing randomly looking binary trees with capital letters in t 阅读全文

posted @ 2018-02-26 21:39 大桃桃 阅读(182) 评论(0) 推荐(0)

UVa 10129 Play on Words(有向图欧拉路径)

摘要: Some of the secret doors contain a very interesting word puzzle. The team of archaeologists has to solve it to open that doors. Because there is no ot 阅读全文

posted @ 2018-02-26 00:18 大桃桃 阅读(188) 评论(0) 推荐(0)

2018年2月25日

UVa 1103 Ancient Messages(二重深搜)

摘要: In order to understand early civilizations, archaeologists often study texts written in ancient languages.One such language, used in Egypt more than 3 阅读全文

posted @ 2018-02-25 13:44 大桃桃 阅读(252) 评论(0) 推荐(0)

2018年2月23日

PAT L2-011 玩转二叉树(二叉树层序遍历)

摘要: 给定一棵二叉树的中序遍历和前序遍历,请你先将树做个镜面反转,再输出反转后的层序遍历的序列。所谓镜面反转,是指将所有非叶结点的左右孩子对换。这里假设键值都是互不相等的正整数。 输入格式: 输入第一行给出一个正整数N(<=30),是二叉树中结点的个数。第二行给出其中序遍历序列。第三行给出其前序遍历序列。 阅读全文

posted @ 2018-02-23 16:36 大桃桃 阅读(370) 评论(0) 推荐(0)

上一页 1 ··· 8 9 10 11 12 13 14 15 下一页

导航