
pat
文章平均质量分 79
肉鸡小龙
这个作者很懒,什么都没留下…
展开
-
ccf 201809-3 元素选择器
代码 #include <iostream> #include <cstdio> #include <vector> #include <string> #include <algorithm> #include <sstream> #include <queue> using namespace std; s...原创 2019-04-21 08:58:02 · 281 阅读 · 0 评论 -
PAT1053 Path of Equal Weight (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 all the nodes along the path from R...原创 2019-04-21 08:58:49 · 336 阅读 · 0 评论 -
PAT1079 Total Sales of Supply Chain (25)(dfs,树的遍历)
题目 A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)– everyone involved in moving a product from supplier to customer. Starting from one root supplier, everyone on t...原创 2019-04-21 08:59:18 · 293 阅读 · 0 评论 -
PAT1020 Tree Traversals (25 分)(二叉树的遍历,后序中序转层序)
###题目 1020 Tree Traversals (25 分) Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level o...原创 2019-04-20 15:35:42 · 225 阅读 · 0 评论 -
PAT1001 A+B Format (20 分)(字符串处理)
##题目 ###分析题目: 两个数字相加,然后需要以一定格式输出。先求相加,然后把数字一个个对10取模输出,相对比较容易。用栈做一个后进后出就好了。 ###代码: #include <iostream> #include <algorithm> #include <stack> using namespace std; stack<char> st...原创 2019-04-20 15:36:20 · 276 阅读 · 0 评论 -
PAT1004 Counting Leaves(30)(BFS,DFS,树的层序遍历)
类型:树的遍历,dfs 题目: A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child. Input Each input file contains one test case. Each case starts ...原创 2019-04-20 15:38:31 · 347 阅读 · 0 评论 -
PAT1003 Emergency (25)(Dijkstra算法)
题目 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 teams in each city and th...原创 2019-04-20 15:39:25 · 432 阅读 · 0 评论 -
PAT1043 Is It a Binary Search Tree (25)(二叉查找树BST)
类型 二叉搜索树, 先序后序转换 题目 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 keys less than the node’s...原创 2019-04-21 08:57:20 · 207 阅读 · 0 评论