PAT
之前做pat的刷题记录,现在主要做leetcode了~
邂逅模拟卷
末流985里的垫底搬砖狗
展开
-
PAT甲级-【题目+解答】汇总
甲级才刚刚开始,之后会陆续整理进来~先附上乙级链接:PAT乙级汇总原创 2020-03-26 15:30:27 · 9419 阅读 · 2 评论 -
PAT甲级-1067 Sort with Swap(0, i) (25分)
点击链接PAT甲级-AC全解汇总题目:Given any permutation of the numbers {0, 1, 2,…, N−1}, it is easy to sort them in increasing order. But what if Swap(0, *) is the ONLY operation that is allowed to use? For example, to sort {4, 0, 2, 1, 3} we may apply the swap operati原创 2020-07-22 10:23:58 · 135 阅读 · 0 评论 -
PAT甲级-1066 Root of AVL Tree (25分)
点击链接PAT甲级-AC全解汇总题目:An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ by more tha...原创 2020-05-06 15:53:23 · 205 阅读 · 0 评论 -
PAT甲级-1065 A+B and C (64bit) (20分)
点击链接PAT甲级-AC全解汇总题目:Given three integers A, B and C in [−263 ,263 ], you are supposed to tell whether A+B>C.Input Specification:The first line of the input gives the positive number of tes...原创 2020-04-27 11:26:40 · 149 阅读 · 0 评论 -
PAT甲级-1064 Complete Binary Search Tree (30分)
点击链接PAT甲级-AC全解汇总题目: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...原创 2020-04-27 10:15:29 · 171 阅读 · 0 评论 -
PAT甲级-1063 Set Similarity (25分)
点击链接PAT甲级-AC全解汇总题目: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 Nt...原创 2020-04-27 09:06:48 · 120 阅读 · 0 评论 -
PAT甲级-1062 Talent and Virtue (25分)【同PAT乙级-1015】
点击链接PAT甲级-AC全解汇总题目:这道题和乙级1015一模一样,直接上链接:PAT乙级-1015 德才论 (25分)注意: 如果超时的话,重新提交试试看我的代码:#include<bits/stdc++.h>using namespace std;class Student{public: Student(){} Student(int id,i...原创 2020-04-26 16:03:13 · 164 阅读 · 0 评论 -
PAT甲级-1061 Dating (20分)【同PAT乙级-1014】
点击链接PAT甲级-AC全解汇总题目:这道题和乙级1014一模一样,直接上链接:PAT乙级-1014 福尔摩斯的约会 (20分)我的代码:#include<bits/stdc++.h>using namespace std;int main(){ char a1[60],a2[60],a3[60],a4[60]; cin>>a1>&g...原创 2020-04-26 15:58:44 · 148 阅读 · 0 评论 -
PAT甲级-1060 Are They Equal (25分)
点击链接PAT甲级-AC全解汇总题目: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 give...原创 2020-04-26 15:41:08 · 308 阅读 · 0 评论 -
PAT甲级-1059 Prime Factors (25分)
点击链接PAT甲级-AC全解汇总题目:Given any positive integer N, you are supposed to find all of its prime factors, and write them in the format N = p1 k1 ×p2 k2 ×⋯×pm km .Input Speci...原创 2020-04-26 15:37:38 · 228 阅读 · 0 评论 -
PAT甲级-1058 A+B in Hogwarts (20分)
点击链接PAT甲级-AC全解汇总题目:If you are a fan of Harry Potter, you would know the world of magic has its own currency system – as Hagrid explained it to Harry, “Seventeen silver Sickles to a Galleon and twent...原创 2020-04-26 15:34:02 · 237 阅读 · 0 评论 -
PAT甲级-1057 Stack (30分)【转载/树状数组】
点击链接PAT甲级-AC全解汇总原文转自:李小白~:1057 Stack (30分)李小白~:树状数组(简单介绍)其他:柳婼:【数据结构】树状数组笔记柳婼:1057. Stack (30)-PAT甲级真题(树状数组)Uncle_Sugar:1057. Stack (30)五种解法总结(大杂烩)非科班出身,这太难了,头秃我的代码:#include<bits/stdc++.h...转载 2020-04-26 15:26:19 · 341 阅读 · 0 评论 -
PAT甲级-1056 Mice and Rice (25分)
点击链接PAT甲级-AC全解汇总题目:Mice and Rice is the name of a programming contest in which each programmer must write a piece of code to control the movements of a mouse in a given map. The goal of each mouse i...原创 2020-04-25 20:24:27 · 348 阅读 · 2 评论 -
PAT甲级-1055 The World's Richest (25分)
点击链接PAT甲级-AC全解汇总题目:Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world’s wealthiest people. Now you are supposed to simulate this job, but concentr...原创 2020-04-21 14:09:51 · 238 阅读 · 0 评论 -
PAT甲级-1054 The Dominant Color (20分)
点击链接PAT甲级-AC全解汇总题目: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 proportional...原创 2020-04-21 11:29:58 · 220 阅读 · 0 评论 -
PAT甲级-1053 Path of Equal Weight (30分)
点击链接PAT甲级-AC全解汇总题目: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 no...原创 2020-04-21 11:22:24 · 210 阅读 · 0 评论 -
PAT甲级-1052 Linked List Sorting (25分)
点击链接PAT甲级-AC全解汇总题目: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 nex...原创 2020-04-21 11:16:29 · 214 阅读 · 0 评论 -
PAT甲级-1051 Pop Sequence (25分)【推荐!!!】
点击链接PAT甲级-AC全解汇总题目: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 possibl...原创 2020-04-19 10:41:05 · 307 阅读 · 0 评论 -
PAT甲级-1050 String Subtraction (20分)
点击链接PAT甲级-AC全解汇总题目:Given two strings S1 and S2 , S=S1 −S2 is defined to be the remaining string after taking all the characters in S2 from S1 . Your task is simply to calculate ...原创 2020-04-17 17:22:54 · 212 阅读 · 0 评论 -
PAT甲级-1049 Counting Ones (30分)
点击链接PAT甲级-AC全解汇总题目:The task is simple: given any positive integer N, you are supposed to count the total number of 1’s in the decimal form of the integers from 1 to N. For example, given N being 12,...原创 2020-04-17 17:13:12 · 204 阅读 · 0 评论 -
PAT甲级-1048 Find Coins (25分)
点击链接PAT甲级-AC全解汇总题目:Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coins ...原创 2020-04-16 16:10:27 · 289 阅读 · 0 评论 -
PAT甲级-1047 Student List for Course (25分)
点击链接PAT甲级-AC全解汇总题目:Zhejiang University has 40,000 students and provides 2,500 courses. Now given the registered course list of each student, you are supposed to output the student name lists of all ...原创 2020-04-16 15:48:32 · 201 阅读 · 0 评论 -
PAT甲级-1046 Shortest Distance (20分)
点击链接PAT甲级-AC全解汇总题目:The task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pair of exits.Input Specification:Ea...原创 2020-04-16 14:42:00 · 270 阅读 · 0 评论 -
PAT甲级-1045 Favorite Color Stripe (30分)
点击链接PAT甲级-AC全解汇总题目: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 sewin...原创 2020-04-16 11:33:18 · 384 阅读 · 0 评论 -
PAT甲级-1044 Shopping in Mars (25分)
点击链接PAT甲级-AC全解汇总题目: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 chain can be...原创 2020-04-13 17:05:58 · 214 阅读 · 1 评论 -
PAT甲级-1043 Is It a Binary Search Tree (25分)
点击链接PAT甲级-AC全解汇总题目: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...原创 2020-04-13 14:25:58 · 239 阅读 · 0 评论 -
PAT甲级-1042 Shuffling Machine (20分)
点击链接PAT甲级-AC全解汇总题目:Shuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techniques are seen as weak, and in order to avoid “inside jobs” where employees col...原创 2020-04-13 13:05:33 · 262 阅读 · 0 评论 -
PAT甲级-1041 Be Unique (20分)
点击链接PAT甲级-AC全解汇总题目:Being unique is so important to people on Mars that even their lottery is designed in a unique way. The rule of winning is simple: one bets on a number chosen from [1,104 ]. Th...原创 2020-04-13 10:53:25 · 211 阅读 · 0 评论 -
PAT甲级-1040 Longest Symmetric String (25分)【推荐!!!】
点击链接PAT甲级-AC全解汇总题目:Given a string, you are supposed to output the length of the longest symmetric sub-string. For example, given Is PAT&TAP symmetric?, the longest symmetric sub-string is s PAT&...原创 2020-04-13 10:33:37 · 349 阅读 · 1 评论 -
PAT甲级-1039 Course List for Student (25分)
点击链接PAT甲级-AC全解汇总题目:Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supposed to output the registered course list for ea...原创 2020-04-10 16:50:21 · 177 阅读 · 0 评论 -
PAT甲级-1038 Recover the Smallest Number (30分)
点击链接PAT甲级-AC全解汇总题目:题意:bi’我的代码:#include<bits/stdc++.h>using namespace std;bool cmp(string a,string b) {return a+b<b+a;}int main(){ vector<string>nums; int N; cin>...原创 2020-04-10 16:00:58 · 223 阅读 · 0 评论 -
PAT甲级-1037 Magic Coupon (25分)
点击链接PAT甲级-AC全解汇总题目: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 times the va...原创 2020-04-10 15:14:33 · 257 阅读 · 0 评论 -
PAT甲级-1036 Boys vs Girls (25分)
点击链接PAT甲级-AC全解汇总题目: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:Each input ...原创 2020-04-10 14:26:03 · 264 阅读 · 0 评论 -
PAT甲级-1035 Password (20分)
点击链接PAT甲级-AC全解汇总题目: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 distingui...原创 2020-04-10 14:07:06 · 284 阅读 · 0 评论 -
PAT甲级-1034 Head of a Gang (30分)
点击链接PAT甲级-AC全解汇总题目: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 of a relati...原创 2020-04-10 13:35:12 · 201 阅读 · 0 评论 -
PAT甲级-1033 To Fill or Not to Fill (25分)
点击链接PAT甲级-AC全解汇总题目:With highways available, driving a car from Hangzhou to any other city is easy. But since the tank capacity of a car is limited, we have to find gas stations on the way from time ...原创 2020-04-10 11:36:42 · 288 阅读 · 0 评论 -
PAT甲级-1027 Colors in Mars (20分)
点击链接PAT甲级-AC全解汇总题目:People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits are for ...原创 2020-04-08 16:50:01 · 196 阅读 · 0 评论 -
PAT甲级-1019 General Palindromic Number (20分)
点击链接PAT甲级-AC全解汇总题目:A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number. All single digit numbers ar...原创 2020-04-03 10:19:31 · 260 阅读 · 0 评论 -
PAT甲级-1014 Waiting in Line (30分)
点击链接PAT甲级-AC全解汇总题目: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...原创 2020-03-30 16:04:35 · 344 阅读 · 0 评论 -
PAT甲级-1032 Sharing (25分)
点击链接PAT甲级-AC全解汇总题目:To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same sublist if they share the same...原创 2020-04-09 14:20:02 · 251 阅读 · 0 评论