
vector
文章平均质量分 78
ryo_218
要努力成为别人的依赖呀!
展开
-
PAT 1006 Sign In and Sign Out (25)
1006 Sign In and Sign Out (25)(25 分)At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the ...原创 2018-08-10 22:04:44 · 179 阅读 · 0 评论 -
PAT 1036 Boys vs Girls (25)
1036 Boys vs Girls (25)(25 分)This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students.Input Specification:...原创 2018-09-04 13:41:50 · 132 阅读 · 0 评论 -
PAT 1037 Magic Coupon (25)
1037 Magic Coupon (25)(25 分)The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, meaning that when you use this coupon with a product, you may get N tim...原创 2018-09-04 17:47:40 · 186 阅读 · 0 评论 -
PAT 1038 Recover the Smallest Number (30)
1038 Recover the Smallest Number (30)(30 分)Given a collection of number segments, you are supposed to recover the smallest number from them. For example, given { 32, 321, 3214, 0229, 87 }, we can re...原创 2018-09-04 19:01:55 · 137 阅读 · 0 评论 -
PAT 1018 Public Bike Management (30)
1018 Public Bike Management (30)(30 分)There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at any station and...原创 2018-09-02 16:45:42 · 177 阅读 · 0 评论 -
PAT 1043 Is It a Binary Search Tree (25)
1043 Is It a Binary Search Tree (25)(25 分)A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with ...原创 2018-09-02 21:18:10 · 159 阅读 · 0 评论 -
PAT 1044 Shopping in Mars (25)
1044 Shopping in Mars (25)(25 分)Shopping in Mars is quite a different experience. The Mars people pay by chained diamonds. Each diamond has a value (in Mars dollars M$). When making the payment, the...原创 2018-09-05 10:54:08 · 160 阅读 · 0 评论 -
PAT 1021 Deepest Root (25)
1021 Deepest Root (25)(25 分)A graph which is connected and acyclic can be considered a tree. The hight of the tree depends on the selected root. Now you are supposed to find the root that results in...原创 2018-09-03 16:17:20 · 134 阅读 · 0 评论 -
PAT 1148 Werewolf - Simple Version (20)
1148 Werewolf - Simple Version (20) (20 分)Werewolf(狼人杀) is a game in which the players are partitioned into two parties: the werewolves and the human beings. Suppose that in a game,player #1 said:...原创 2018-09-09 17:26:28 · 1130 阅读 · 0 评论 -
PAT 1149 Dangerous Goods Packaging (25)
1149 Dangerous Goods Packaging (25) (25 分)When shipping goods with containers, we have to be careful not to pack some incompatible goods into the same container, or we might get ourselves in serious...原创 2018-09-09 20:44:36 · 309 阅读 · 0 评论 -
PAT 1034 Head of a Gang (30)
1034 Head of a Gang (30)(30 分)One way that the police finds the head of a gang is to check people's phone calls. If there is a phone call between A and B, we say that A and B is related. The weight ...原创 2018-09-04 13:24:32 · 171 阅读 · 0 评论 -
PAT 1004 Counting Leaves (30)
1004 Counting Leaves (30)(30 分)A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.Input Specification:Each input file contain...原创 2018-08-28 22:09:14 · 152 阅读 · 0 评论 -
PAT 1094 The Largest Generation (25)
1094 The Largest Generation (25)(25 分)A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same generation. Your task is to find the generat...原创 2018-08-06 17:33:27 · 242 阅读 · 0 评论 -
第九届蓝桥杯省赛C++B组 日志统计
标题:日志统计小明维护着一个程序员论坛。现在他收集了一份"点赞"日志,日志共有N行。其中每一行的格式是:ts id 表示在ts时刻编号id的帖子收到一个"赞"。 现在小明想统计有哪些帖子曾经是"热帖"。如果一个帖子曾在任意一个长度为D的时间段内收到不少于K个赞,小明就认为这个帖子曾是"热帖"。 具体来说,如果存在某个时刻T满足该帖在[T, T+D)这段时间内(注意是左闭右...原创 2018-04-04 22:06:08 · 2625 阅读 · 9 评论 -
第四届蓝桥杯省赛C++A组 大臣的旅费
标题:大臣的旅费很久以前,T王国空前繁荣。为了更好地管理国家,王国修建了大量的快速路,用于连接首都和王国内的各大城市。为节省经费,T国的大臣们经过思考,制定了一套优秀的修建方案,使得任何一个大城市都能从首都直接或者通过其他大城市间接到达。同时,如果不重复经过大城市,从首都到达每个大城市的方案都是唯一的。J是T国重要大臣,他巡查于各大城市之间,体察民情。所以,从一个城市马不停蹄地到另一个...原创 2018-03-28 20:01:31 · 668 阅读 · 0 评论 -
第六届蓝桥杯省赛C++B组 生命之树
生命之树在X森林里,上帝创建了生命之树。他给每棵树的每个节点(叶子也称为一个节点)上,都标了一个整数,代表这个点的和谐值。上帝要在这棵树内选出一个非空节点集S,使得对于S中的任意两个点a,b,都存在一个点列 {a, v1, v2, ..., vk, b} 使得这个点列中的每个点都是S里面的元素,且序列中相邻两个点间有一条边相连。在这个前提下,上帝要使得S中的点所对应的整数的和尽量大。...原创 2018-03-24 22:13:40 · 1252 阅读 · 0 评论 -
PAT 1079 Total Sales of Supply Chain (25)
1079 Total Sales of Supply Chain (25)(25 分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.St...原创 2018-08-07 15:50:08 · 159 阅读 · 0 评论 -
PAT 1053 Path of Equal Weight (30)
1053 Path of Equal Weight (30)(30 分)Given a non-empty tree with root R, and with weight Wi assigned to each tree node Ti. The weight of a path from R to L is defined to be the sum of the weights of ...原创 2018-08-08 14:40:36 · 241 阅读 · 0 评论 -
PAT 1090 Highest Price in Supply Chain (25)
1090 Highest Price in Supply Chain (25)(25 分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer....原创 2018-08-08 22:07:18 · 212 阅读 · 0 评论 -
PAT 1003 Emergency (25)
1003 Emergency (25)(25 分)As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue t...原创 2018-08-30 21:50:43 · 279 阅读 · 0 评论 -
PAT 1009 Product of Polynomials (25)
1009 Product of Polynomials (25)(25 分)This time, you are supposed to find A×B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 l...原创 2018-08-30 22:40:53 · 141 阅读 · 0 评论 -
第八届蓝桥杯国赛C++B组 发现环
标题:发现环小明的实验室有N台电脑,编号1~N。原本这N台电脑之间有N-1条数据链接相连,恰好构成一个树形网络。在树形网络上,任意两台电脑之间有唯一的路径相连。不过在最近一次维护网络时,管理员误操作使得某两台电脑之间增加了一条数据链接,于是网络中出现了环路。环路上的电脑由于两两之间不再是只有一条路径,使得这些电脑上的数据传输出现了BUG。为了恢复正常传输。小明需要找到所有在环路上的电脑...原创 2019-03-21 11:16:28 · 960 阅读 · 5 评论