PAT相关
文章平均质量分 74
PAT等级考试相关刷题
sweetheart7-7
技术源于热爱 ---------------------- 学习改变命运,知识改变未来 ---------------------- Architect-Road
展开
-
PAT 甲级常见单词整理
PAT 甲级常见单词整理。原创 2022-09-17 12:03:13 · 247 阅读 · 0 评论 -
天梯赛/PAT甲级常考知识点整理
当输入数据 >= 10^5 时,用 scanf,printf注意边界情况特判!!!!比如为空之类的!向上取整:(n + m - 1) / m;bfs()搜索时,在加入队列时,就需要标记已经被搜过如果向让数字逆序,则在加入容器时加负号即可strcmp(od, "Pop") == 0long double 精度比 double 高long double res = 123.45554; printf("%.2Lf\n", res);vector的erase函数:ets.era原创 2022-04-23 10:05:24 · 1160 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1089 Insert or Merge (25 分)
According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input data, finds the location it belongs within the sorted list, an原创 2022-02-22 23:01:57 · 228 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1098 Insertion or Heap Sort (25 分)
According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input data, finds the location it belongs within the sorted list, an原创 2022-02-22 23:01:31 · 146 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1075 PAT Judge (25 分)
The ranklist of PAT is generated from the status list, which shows the scores of the submissions. This time you are supposed to generate the ranklist for PAT.Input Specification:Each input file contains one test case. For each case, the first line contai原创 2022-02-22 22:48:00 · 231 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】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原创 2022-02-22 22:24:50 · 134 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1039 Course List for Student (25 分)
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 each student who comes for a query.Input Specification:Each原创 2022-02-22 22:11:28 · 199 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1028 List Sorting (25 分)
Excel can sort records according to any column. Now you are supposed to imitate this function.Input Specification:Each input file contains one test case. For each case, the first line contains two integers N(≤105)N (≤10^5)N(≤105) and CCC, where NNN is th原创 2022-02-22 22:05:49 · 134 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1025 PAT Ranking (25 分)
Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run simultaneously in several places, and the ranklists will be merged immediately after the test. Now it is your原创 2022-02-22 21:51:22 · 327 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1022 Digital Library (30 分)
A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years. Each book is assigned an unique 7-digit number as its ID. Given any query from a reader, you are suppose原创 2022-02-20 22:41:44 · 132 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1012 The Best Rank (25 分)
To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programming Language, M - Mathematics (Calculus or Linear Algrbra), and E - English. At the mean time, we encourage students by emphasi原创 2022-02-20 22:17:07 · 344 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1100 Mars Numbers (20 分)
People on Mars count their numbers with base 131313:Zero on Earth is called “tret” on Mars.The numbers 1 to 12 on Earth is called “jan, feb, mar, apr, may, jun, jly, aug, sep, oct, nov, dec” on Mars, respectively.For the next higher digit, Mars people原创 2022-02-20 21:09:40 · 134 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1027 Colors in Mars (20 分)
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 666-digit number, where the first 222 digits are for Red, the middle 222 digits for Green, and the last 222 digits for Blue. T原创 2022-02-20 20:04:24 · 148 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1015 Reversible Primes (20 分)
A reversible prime in any number system is a prime whose “reverse” in that number system is also a prime. For example in the decimal system 737373 is a reversible prime because its reverse 373737 is also a prime.Now given any two positive integers N(<1原创 2022-02-20 19:27:57 · 192 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1010 Radix (25 分)
Given a pair of positive integers, for example, 666 and 110110110, can this equation 6=1106 = 1106=110 be true? The answer is yes, if 666 is a decimal number and 110110110 is a binary number.Now for any pair of positive integers N1N_1N1 and N2N_2N2 , yo原创 2022-02-20 18:32:58 · 143 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1024 Palindromic Number (25 分)
A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 123432112343211234321 is a palindromic number. All single digit numbers are palindromic numbers.Non-palindromic numbers can be paired wi原创 2022-02-20 18:17:19 · 145 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1023 Have Fun with Numbers (20 分)
Notice that the number 123456789123456789123456789 is a 999-digit number consisting exactly the numbers from 111 to 999, with no duplication. Double it we will obtain 246913578246913578246913578, which happens to be another 999-digit number consisting exac原创 2022-02-20 18:02:09 · 146 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1009 Product of Polynomials (25 分)
This time, you are supposed to find A×BA×BA×B where AAA and BBB are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 222 lines, and each line contains the information of a polynomial:K N1 aN1原创 2022-02-20 17:57:10 · 138 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1002 A+B for Polynomials (25 分)
This time, you are supposed to find A+B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial:K N1 aN1 N2 aN2&原创 2022-02-20 17:43:34 · 149 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1026 Table Tennis (30 分)
A table tennis club has NNN tables available to the public. The tables are numbered from 111 to NNN. For any pair of players, if there are some tables open when they arrive, they will be assigned to the available table with the smallest number. If all the原创 2022-02-18 15:01:56 · 293 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1017 Queueing at Bank (25 分)
Suppose a bank has KKK windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All the customers have to wait in line behind the yellow line, until it is his/her turn to be served and there is原创 2022-02-18 14:41:25 · 542 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1016 Phone Bills (25 分)
A long-distance telephone company charges its customers by the following rules:Making a long-distance call costs a certain amount per minute, depending on the time of day when the call is made. When a customer starts connecting a long-distance call, the t原创 2022-02-18 13:05:28 · 577 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1061 Dating (20 分)
Sherlock Holmes received a note with some strange strings: Let's date! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm. It took him only a minute to figure out that those strange strings are actually referring to the coded time Thursday 14:04原创 2022-02-18 12:39:24 · 303 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】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原创 2022-02-16 18:08:37 · 132 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1050 String Subtraction (20 分)
Given two strings S1S_1S1 and S2S_2S2, S=S1−S2S=S_1−S_2S=S1−S2 is defined to be the remaining string after taking all the characters in S2S_2S2 from S1S_1S1. Your task is simply to calculate S1−S2S_1−S_2S1−S2 for any given strings. However, it migh原创 2022-02-16 17:01:46 · 273 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1036 Boys vs Girls (25 分)
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 file contains one test case. Each case contains a positive integer NNN, follo原创 2022-02-16 16:10:51 · 394 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】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 distinguish 1 (one) from l (L in lowercase), or 0 (zero) from O (o in uppercase). One原创 2022-02-16 14:33:54 · 179 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1006 Sign In and Sign Out (25 分)
At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the records of signing in’s and out’s, you are supposed to find the ones who have unlocked and loc原创 2022-02-16 13:09:03 · 279 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1005 Spell It Right (20 分)
Given a non-negative integer NNN, your task is to compute the sum of all the digits of NNN, and output every digit of the sum in English.Input Specification:Each input file contains one test case. Each case occupies one line which contains an N(≤10100)N原创 2022-02-16 12:27:09 · 334 阅读 · 0 评论 -
【PAT (Advanced Level) Practice】1001 A+B Format (20 分)
Calculate a+ba+ba+b and output the sum in standard format – that is, the digits must be separated into groups of three by commas (unless there are less than four digits).Input Specification:Each input file contains one test case. Each case contains aaa p原创 2022-02-16 12:00:53 · 411 阅读 · 0 评论 -
【PAT】A1086 Tree Traversals Again - C++
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(原创 2022-02-14 10:37:05 · 191 阅读 · 0 评论