随笔分类 -  PAT

摘要:题目描述 一个无环的有向图称为无环图(Directed Acyclic Graph),简称DAG图。 AOE(Activity On Edge)网:顾名思义,用边表示活动的网,当然它也是DAG。与AOV不同,活动都表示在了边上,如下图所示: 如上所示,共有11项活动(11条边),9个事件(9个顶点) 阅读全文
posted @ 2018-09-07 21:00 深圳地铁Princess 阅读(1099) 评论(1) 推荐(0)
摘要:真是棒棒哒!!!深圳地铁prince,你听到了吗???(PS:犯什么呆萌?还不滚去刷题?) The task of this problem is simple: insert a sequence of distinct positive integers into a hash table fi 阅读全文
posted @ 2018-09-07 18:34 深圳地铁Princess 阅读(156) 评论(0) 推荐(0)
摘要: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 s 阅读全文
posted @ 2018-08-22 17:36 深圳地铁Princess 阅读(244) 评论(0) 推荐(0)
摘要: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 re 阅读全文
posted @ 2018-08-22 16:32 深圳地铁Princess 阅读(213) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2018-08-21 15:43 深圳地铁Princess 阅读(159) 评论(0) 推荐(0)
摘要:A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the 阅读全文
posted @ 2018-08-20 16:28 深圳地铁Princess 阅读(130) 评论(0) 推荐(0)
摘要: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 t 阅读全文
posted @ 2018-08-20 16:25 深圳地铁Princess 阅读(118) 评论(0) 推荐(0)
摘要:A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer 阅读全文
posted @ 2018-08-20 16:22 深圳地铁Princess 阅读(218) 评论(0) 推荐(0)
摘要:It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that c 阅读全文
posted @ 2018-08-19 18:38 深圳地铁Princess 阅读(132) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2018-08-19 16:20 深圳地铁Princess 阅读(145) 评论(0) 推荐(0)
摘要:A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer 阅读全文
posted @ 2018-08-18 17:40 深圳地铁Princess 阅读(89) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2018-08-17 19:20 深圳地铁Princess 阅读(168) 评论(0) 推荐(0)
摘要:Given a non-empty tree with root R, and with weight W~i~ assigned to each tree node T~i~. The weight of a path from R to L is defined to be the sum of 阅读全文
posted @ 2018-08-16 17:43 深圳地铁Princess 阅读(178) 评论(0) 推荐(0)
摘要:2018 年,杭州城的生活是这样的:萧山机场 T3 航站楼的安检员每扫描 3000 个瑞士双肩包,就有 2200 个装着写满代码的笔记本;阿里西溪园区的星巴克,销量号称亚洲 Top 3,一天至少卖出 200 杯焦糖玛奇朵;余杭区的出租车司机每天能拉到 13 个谈论 App 开发的乘客,收到的现金不会 阅读全文
posted @ 2018-08-16 08:05 深圳地铁Princess 阅读(348) 评论(0) 推荐(0)
摘要:这个代码是抄的是抄的是抄的。只要记录最左和最右就好了,我当时怎么没想到😔。 阅读全文
posted @ 2018-08-15 18:34 深圳地铁Princess 阅读(155) 评论(0) 推荐(0)
摘要:牛客上也发现了这道题 我的代码竟然过了 看了一下讨论区 好几个人都是dfs的思想 所以其实codeup要求的是更优的一种做法。下篇博客再来写吧。 阅读全文
posted @ 2018-08-15 12:19 深圳地铁Princess 阅读(159) 评论(0) 推荐(0)
摘要:问题 B: 二叉树 题目描述 如上所示,由正整数1,2,3……组成了一颗特殊二叉树。我们已知这个二叉树的最后一个结点是n。现在的问题是,结点m所在的子树中一共包括多少个结点。 比如,n = 12,m = 3那么上图中的结点13,14,15以及后面的结点都是不存在的,结点m所在子树中包括的结点有3,6 阅读全文
posted @ 2018-08-15 11:50 深圳地铁Princess 阅读(263) 评论(0) 推荐(0)
摘要:A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years 阅读全文
posted @ 2018-08-14 19:54 深圳地铁Princess 阅读(161) 评论(0) 推荐(0)
摘要:/********************** author: yomi date: 18.8.14 ps:入门题果然很简单, 我觉得比选数,选物品什么的简单多了呀。 只要控制好递归边界和递归式就没问题。 **********************/ #include #include #include using namespace std; int n, m, ans = 0;... 阅读全文
posted @ 2018-08-14 19:15 深圳地铁Princess 阅读(151) 评论(0) 推荐(0)
摘要:Lake Counting Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 45142 Accepted: 22306 Description Due to recent rains, water has pooled in va 阅读全文
posted @ 2018-08-14 19:02 深圳地铁Princess 阅读(246) 评论(0) 推荐(0)