PAT
文章平均质量分 81
DrinkM1lk
这个作者很懒,什么都没留下…
展开
-
PAT甲级 1103 Integer Factorization(30分)
PAT甲级题解原创 2022-08-11 09:33:46 · 83 阅读 · 0 评论 -
PAT甲级 1060 Are They Equal(25分)
PAT甲级题解原创 2022-08-04 10:24:11 · 76 阅读 · 0 评论 -
PAT甲级1034 Head of a Gang(30分)
PAT甲级题解原创 2022-07-31 08:57:23 · 199 阅读 · 0 评论 -
PAT甲级 1033 To Fill or Not to Fill(25分)
PAT甲级题解原创 2022-07-29 17:34:44 · 76 阅读 · 0 评论 -
PAT甲级 1127 ZigZagging on a Tree (30 分)
Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and inorder traversal sequences. And it is a simple standard routine to print the numbers in level-order. However原创 2021-09-08 21:14:04 · 147 阅读 · 0 评论 -
PAT甲级 1045 Favorite Color Stripe (30 分)
Eva is trying to make her own color stripe out of a given one. She would like to keep only her favorite colors in her favorite order by cutting off those unwanted pieces and sewing the remaining parts together to form her favorite color stripe. It is said原创 2021-09-04 20:29:04 · 100 阅读 · 0 评论 -
PAT甲级 1007 Maximum Subsequence Sum (25 分)
Given a sequence of K integers { N1, N2, ..., NK }. A continuous subsequence is defined to be { Ni, Ni+1, ..., Nj } where 1≤i≤j≤K. The Maximum Subsequence is the continuous subsequence which has the largest sum of its elements. For example, given seq原创 2021-09-04 20:10:01 · 56 阅读 · 0 评论 -
PAT甲级 1087 All Roads Lead to Rome (30 分)
Indeed there are many different tourist routes from our city to Rome. You are supposed to find your clients the route with the least cost while gaining the most happiness. Input Specification: Each input file contains one test case. For each case, the fi原创 2021-09-04 19:26:39 · 328 阅读 · 0 评论 -
PAT甲级 1072 Gas Station (30 分)
A gas station has to be built at such a location that the minimum distance between the station and any of the residential housing is as far away as possible. However it must guarantee that all the houses are in its service range. Now given the map of the原创 2021-09-03 20:51:34 · 75 阅读 · 0 评论 -
PAT甲级 1018 Public Bike Management (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 return it to any other stations in the city. The Public Bike Management Center (PBMC) keeps mo原创 2021-09-02 21:14:23 · 93 阅读 · 0 评论 -
PAT甲级 1076 Forwards on Weibo (30 分)
Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, and may follow many other users as well. Hence a social network is formed with followers relations. When a user makes a post on Weibo, all his/her followers can vi原创 2021-09-01 21:16:58 · 53 阅读 · 0 评论 -
PAT甲级 1013 Battle Over Cities (25 分)
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 city are closed. We must know immediately if we need to repair any other highways to keep the rest of the c原创 2021-09-01 19:39:21 · 58 阅读 · 0 评论 -
PAT甲级 1107 Social Clusters (30 分)
When register on a social network, you are always asked to specify your hobbies in order to find some potential friends with the same hobbies. A social cluster is a set of people who have some of their hobbies in common. You are supposed to find all the cl原创 2021-08-31 21:15:33 · 53 阅读 · 0 评论 -
PAT甲级 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 subtree of a node contains only nodes with keys greater th原创 2021-08-31 20:43:52 · 50 阅读 · 0 评论 -
PAT甲级 1079 Total Sales of Supply Chain (25 分)
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 the chain buys products from one's supplier in a price P a原创 2021-08-30 19:52:18 · 54 阅读 · 0 评论 -
PAT甲级 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 stack operations are: push(1); push(2); push(3); pop(); pop(原创 2021-08-30 19:14:25 · 47 阅读 · 0 评论 -
PAT甲级 1091 Acute Stroke (30 分)
One important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the results of image analysis in which the core regions are identified in each MRI slice, your job is to calculate the volume of the stroke core. Input Specifica原创 2021-08-30 18:42:13 · 54 阅读 · 0 评论 -
PAT甲级 1052 Linked List Sorting (25 分)
A linked list consists of a series of structures, which are not necessarily adjacent in memory. We assume that each structure contains an integer key and a Next pointer to the next structure. Now given a linked list, you are supposed to sort the structures原创 2021-08-29 18:30:21 · 59 阅读 · 0 评论 -
PAT甲级 1051 Pop Sequence (25 分)
Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, ..., N and pop randomly. You are supposed to tell if a given sequence of numbers is a possible pop sequence of the stack. For example, if M is 5 and N is 7, we can obta原创 2021-08-29 17:55:18 · 66 阅读 · 0 评论 -
PAT甲级 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 help to narrow down a speaker's identity, which is useful when validating, for exampl原创 2021-08-29 16:43:05 · 54 阅读 · 0 评论 -
PAT 1060 Are They Equal (25 分)
If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0.123×105 with simple chopping. Now given the number of significant digits on a machine and two float numbers, you are su原创 2021-08-28 22:50:58 · 46 阅读 · 0 评论 -
PAT甲级1080 Graduate Admission (30 分)
#include <bits/stdc++.h> using namespace std; struct student { int id,ge,gi,finalscore,rank; int wants[5]; bool admit=false; }; bool cmp1(student a,student b) { if(a.finalscore!=b.finalscore) return a.finalscore>b.finalscore; .原创 2021-08-22 18:04:49 · 77 阅读 · 0 评论