STL
文章平均质量分 81
水果妹妹踩前端的坑
这个作者很懒,什么都没留下…
展开
-
PAT甲级--1116 Come on! Let's C(20 分)【模拟题+简单逻辑】
1116 Come on! Let's C(20 分)"Let's C" is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejiang University. Since the idea of the contest is for fun,...原创 2018-08-31 10:32:39 · 254 阅读 · 0 评论 -
1071 Speech Patterns (25 分)【map的使用】
1071 Speech Patterns (25 分)People often have a preference among synonyms of the same word. For example, some may prefer "the police", while others may prefer "the cops". Analyzing such patterns can ...原创 2018-11-08 17:24:07 · 335 阅读 · 1 评论 -
1063 Set Similarity (25 分)【STL中vector与set的使用】
1063 Set Similarity (25 分)Given two sets of integers, the similarity of the sets is defined to be Nc/Nt×100%, where Nc is the number of distinct common numbers shared by the two sets, and N...原创 2018-11-15 15:30:11 · 162 阅读 · 0 评论 -
1057 Stack (30 分)【stack模拟+二分】
1057 Stack (30 分)Stack is one of the most fundamental data structures, which is based on the principle of Last In First Out (LIFO). The basic operations include Push (inserting an element onto the t...原创 2018-11-12 11:28:15 · 1459 阅读 · 4 评论 -
1153 Decode Registration Card of PAT (25 分)【模拟(易超时)】
1153 Decode Registration Card of PAT (25 分)A registration card number of PAT consists of 4 parts:the 1st letter represents the test level, namely, T for the top level, A for advance and B for basi...原创 2018-12-30 09:52:35 · 599 阅读 · 0 评论 -
PAT甲级--1154 Vertex Coloring (25 分)【hash】
A proper vertex coloring is a labeling of the graph's vertices with colors such that no two vertices sharing the same edge have the same color. A coloring using at most k colors is called a (proper) k...原创 2018-12-30 21:59:57 · 322 阅读 · 0 评论 -
1099 Build A Binary Search Tree (30 分)【中序+层序】
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 key. The right su...原创 2019-01-06 13:49:37 · 293 阅读 · 0 评论 -
1155 Heap Paths (30 分)【dfs】
In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) of P is either greater than or equal to (i...原创 2019-01-02 16:52:47 · 229 阅读 · 0 评论 -
1086 Tree Traversals Again (25 分)【前序中序转为后序】
An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the keys numbered from 1 to 6) is traversed, the s...原创 2019-01-02 20:26:06 · 309 阅读 · 0 评论 -
1035 Password (20 分)【模拟】
1035 Password (20 分)To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distingu...原创 2018-11-05 09:52:55 · 364 阅读 · 0 评论 -
PAT甲级--1014 Waiting in Line (30 分)【队列的使用】
Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rules for the customers to wait in line are:The sp...原创 2018-10-27 19:57:10 · 403 阅读 · 0 评论 -
zcmu1827: 区间k大数查询
Description给定一个序列,每次询问序列中第l个数到第r个数中第K大的数是哪个。Input 第一行包含一个数n,表示序列长度。 第二行包含n个正整数,表示给定的序列。 第三个包含一个正整数m,表示询问个数。 接下来m行,每行三个数l,r,K,表示询问序列从左往右第l个数到第r个数中,从大往小第K大的数是哪个。序列元素从1开始标号。对于100%的数据,n,m< =100...原创 2018-10-22 10:55:42 · 239 阅读 · 0 评论 -
1124 Raffle for Weibo Followers(20 分)
1124 Raffle for Weibo Followers(20 分)John got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for his followers on Weibo -- that is, he would select winners from every N fol...原创 2018-08-31 13:54:51 · 513 阅读 · 0 评论 -
PAT甲级--1102 Invert a Binary Tree(25 分)【反转二叉树+层序遍历+中序遍历】
1102 Invert a Binary Tree(25 分)The following is from Max Howell @twitter:Google: 90% of our engineers use the software you wrote (Homebrew), but you can't invert a binary tree on a whiteboard so ...原创 2018-08-31 21:01:12 · 311 阅读 · 0 评论 -
PAT甲级--1094 The Largest Generation(25 分)【DFS+BFS+输出一层最多的结点数】
1094 The Largest Generation(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 generation w...原创 2018-09-01 16:33:08 · 213 阅读 · 0 评论 -
PAT甲级--1021 Deepest Root(25 分)【dfs+连通分量+STL】
1021 Deepest Root(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 a hi...原创 2018-09-04 14:59:27 · 506 阅读 · 0 评论 -
PAT--1141 PAT Ranking of Institutions(25 分)
1141 PAT Ranking of Institutions(25 分)After each PAT, the PAT Center will announce the ranking of institutions based on their students' performances. Now you are asked to generate the ranklist.Inp...原创 2018-08-30 14:07:56 · 352 阅读 · 0 评论 -
ACM-ICPC 2018 徐州赛区网络预赛F. Features Track【STL中map和pair的结合】
F. Features Track题目链接Morgana is learning computer vision, and he likes cats, too. One day he wants to find the cat movement from a cat video. To do this, he extracts cat features in each frame. A ...原创 2018-09-11 18:51:36 · 163 阅读 · 0 评论 -
zcmu--4925: 字符串的查找删除【find函数使用】
4925: 字符串的查找删除Time Limit: 1 Sec Memory Limit: 32 MBSubmit: 24 Solved: 10[Submit][Status][Web Board]Description给定一个短字符串(不含空格),再给定若干字符串,在这些字符串中删除所含有的短字符串。Input输入只有1组数据。输入一个短字符串(不含空格),再输入若...原创 2018-09-10 22:23:23 · 249 阅读 · 0 评论 -
zcmu1773: Mode【简单】
1773: ModeDescriptiongive you a number of n series, in which a number of more than n / 2 times , you should find out that the number (n<=500000,x<=10^19)InputThe first line is a positive...原创 2018-10-14 18:08:46 · 269 阅读 · 0 评论 -
PAT甲级1054 The Dominant Color (20 分)【STL】
1054 The Dominant Color (20 分)Behind the scenes in the computer's memory, color is always talked about as a series of 24 bits of information for each pixel. In an image, the color with the largest p...原创 2019-02-25 11:26:50 · 229 阅读 · 0 评论