
PAT甲级
PAT甲级的刷题记录,并不是按顺序刷的:P
囷囷
一个时常摸鱼的研究生
展开
-
PAT甲级刷题记录——1111 Online Map (30分)
Input our current position and a destination, an online map can recommend several paths. Now your job is to recommend two paths to your user: one is the shortest, and the other is the fastest. It is guaranteed that a path exists for any request.Input Spec原创 2020-05-27 11:08:38 · 356 阅读 · 0 评论 -
PAT甲级刷题记录——1140 Look-and-say Sequence (20分)
Look-and-say sequence is a sequence of integers as the following:D, D1, D111, D113, D11231, D112213111, ...where Dis in [0, 9] except 1. The (n+1)st number is a kind of description of the nth number. For example, the 2nd number means that there is one D原创 2020-05-24 11:34:52 · 261 阅读 · 0 评论 -
PAT甲级刷题记录——1144 The Missing Number (20分)
Given N integers, you are supposed to find the smallest positive integer that is NOT in the given list.Input Specification:Each input file contains one test case. For each case, the first line gives a positive integer N (≤105 ). Then N integers are gi原创 2020-05-24 10:51:53 · 197 阅读 · 0 评论 -
PAT甲级刷题记录——1147 Heaps (30分)
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 (in a max heap) or less than or equal to (in a min heap) t原创 2020-05-24 10:24:13 · 219 阅读 · 0 评论 -
PAT甲级刷题记录——1152 Google Recruitment (20分)
In July 2004, Google posted on a giant billboard along Highway 101 in Silicon Valley (shown in the picture below) for recruitment. The content is super-simple, a URL consisting of the first 10-digit prime found in consecutive digits of the natural constant原创 2020-05-19 22:53:51 · 524 阅读 · 0 评论 -
PAT甲级刷题记录——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, Tfor the top level, Afor advance and Bfor basic;the 2nd - 4th digits are the test site number, ranged from 101 to 999;the 5th - 10th digits give the原创 2020-05-16 11:47:30 · 301 阅读 · 0 评论 -
PAT甲级刷题记录——1154 Vertex Coloring (25分)
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-coloring.Now you are supposed to tell if a given color原创 2020-05-11 09:51:07 · 231 阅读 · 0 评论 -
PAT甲级刷题记录——1031 Hello World for U (20分)
Given any string of N (≥5) characters, you are asked to form the characters into the shape of U. For example, helloworldcan be printed as:h de ll rlowoThat is, the characters must be printed in the original order, starting top-down from the left v原创 2020-05-10 10:23:29 · 184 阅读 · 0 评论 -
PAT甲级刷题记录——1058 A+B in Hogwarts (20分)
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 twenty-nine Knuts to a Sickle, it’s easy enough.” Your job is to write a program t原创 2020-05-10 09:07:27 · 362 阅读 · 0 评论 -
PAT甲级刷题记录——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 6-digit number, where the first 2 digits are for Red, the middle 2 digits for Green, and the last 2 digits for Blue. The only原创 2020-05-10 08:45:37 · 214 阅读 · 0 评论 -
PAT甲级刷题记录——1019 General Palindromic Number (20分)
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 are palindromic numbers.Although palindromic numbers are most often considered原创 2020-05-10 08:33:23 · 208 阅读 · 1 评论 -
PAT甲级刷题记录——1082 Read Number in Chinese (25分)
Given an integer with no more than 9 digits, you are supposed to read it in the traditional Chinese way. Output Fufirst if it is negative. For example, -123456789 is read as Fu yi Yi er Qian san Bai si Shi wu Wan liu Qian qi Bai ba Shi jiu. Note: zero (lin原创 2020-05-09 10:17:41 · 285 阅读 · 0 评论 -
PAT甲级刷题记录——1077 Kuchiguse (20分)
The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the speaker’s personality. Such a preference is called “Kuchiguse” and is often exaggerated artistically in Ani原创 2020-05-09 08:51:28 · 601 阅读 · 0 评论 -
PAT甲级刷题记录——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(Lin lowercase), or 0(zero) from O(oin uppercase). One soluti原创 2020-05-08 21:52:47 · 192 阅读 · 0 评论 -
PAT甲级刷题记录——1073 Scientific Notation (20分)
Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [±][1-9].[0-9]+E[±][0-9]+ which means that the integer portion has exactly one digit, there is at least one d原创 2020-05-08 18:41:12 · 312 阅读 · 1 评论 -
PAT甲级刷题记录——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...原创 2020-05-08 16:42:34 · 502 阅读 · 1 评论 -
PAT甲级刷题记录——1095 Cars on Campus (30分)
Zhejiang University has 8 campuses and a lot of gates. From each gate we can collect the in/out times and the plate numbers of the cars crossing the gate. Now with all the information available, you a...原创 2020-05-07 12:53:38 · 533 阅读 · 1 评论 -
PAT甲级刷题记录——1080 Graduate Admission (30分)
It is said that in 2011, there are about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Province. It would help a lot if you could write a program to automate the admission...原创 2020-05-06 17:04:50 · 260 阅读 · 0 评论 -
PAT甲级刷题记录——1083 List Grades (25分)
Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student records of which the grades ...原创 2020-05-06 16:07:56 · 217 阅读 · 0 评论 -
PAT甲级刷题记录——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 cont...原创 2020-05-06 14:28:54 · 251 阅读 · 0 评论 -
PAT甲级刷题记录——1055 The World's Richest (25分)
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 concentrate only on the peopl...原创 2020-05-06 11:02:34 · 368 阅读 · 0 评论 -
PAT甲级刷题记录——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 i...原创 2020-05-06 10:33:30 · 210 阅读 · 0 评论 -
PAT甲级刷题记录——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 w...原创 2020-05-06 10:01:35 · 241 阅读 · 0 评论 -
PAT甲级刷题记录——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- Englis...原创 2020-05-05 16:55:50 · 294 阅读 · 0 评论 -
PAT甲级刷题记录——1062 Talent and Virtue (25分)
About 900 years ago, a Chinese philosopher Sima Guang wrote a history book in which he talked about people’s talent and virtue. According to his theory, a man being outstanding in both talent and virt...原创 2020-05-05 15:55:56 · 280 阅读 · 0 评论 -
PAT甲级刷题记录——1050 String Subtraction (20分)
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 S1 −S2 for any...原创 2020-05-04 17:15:14 · 157 阅读 · 0 评论 -
PAT甲级刷题记录——1041 Be Unique (20分)
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 ]. The first one who bets ...原创 2020-05-04 17:07:48 · 176 阅读 · 0 评论 -
PAT甲级刷题记录——1092 To Buy or Not to Buy (20分)
Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. There were many colorful strings of beads. However the owner of the shop would only sel...原创 2020-05-04 16:03:05 · 200 阅读 · 0 评论 -
PAT甲级刷题记录——1084 Broken Keyboard (20分)
On a broken keyboard, some of the keys are worn out. So when you type some sentences, the characters corresponding to those keys will not appear on screen.Now given a string that you are supposed to ...原创 2020-05-04 11:10:15 · 196 阅读 · 0 评论 -
PAT甲级刷题记录——1038 Recover the Smallest Number (30分)
Given a collection of number segments, you are supposed to recover the smallest number from them. For example, given { 32, 321, 3214, 0229, 87 }, we can recover many numbers such like 32-321-3214-0229...原创 2020-05-03 19:07:13 · 138 阅读 · 0 评论 -
PAT甲级刷题记录——1067 Sort with Swap(0, i) (25分)
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...原创 2020-05-03 17:09:21 · 222 阅读 · 0 评论 -
PAT甲级刷题记录——1037 Magic Coupon (25分)
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 value of that product b...原创 2020-05-03 14:51:31 · 177 阅读 · 0 评论 -
PAT甲级刷题记录——1070 Mooncake (25分)
Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional mooncakes according to the region’s culture. Now ...原创 2020-05-03 14:03:51 · 332 阅读 · 0 评论 -
PAT甲级刷题记录——1044 Shopping in Mars (25分)
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 cut at any position ...原创 2020-05-03 12:40:52 · 395 阅读 · 0 评论 -
PAT甲级刷题记录——1010 Radix (25分)
Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is yes, if 6 is a decimal number and 110 is a binary number.Now for any pair of positive integ...原创 2020-05-02 20:19:31 · 252 阅读 · 0 评论 -
PAT甲级刷题记录——1101 Quick Sort (25分)
There is a classical process named partition in the famous quick sort algorithm. In this process we typically choose one element as the pivot. Then the elements less than the pivot are moved to its le...原创 2020-05-02 14:36:20 · 181 阅读 · 0 评论 -
PAT甲级刷题记录——1093 Count PAT's (25分)
The string APPAPTcontains two PAT's as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed by the 3rd, the 4th, and the 6th characters.Now gi...原创 2020-05-02 14:00:49 · 152 阅读 · 0 评论 -
PAT甲级刷题记录——1048 Find Coins (25分)
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 as payments. However,...原创 2020-05-02 11:41:55 · 247 阅读 · 0 评论 -
PAT甲级刷题记录——1029 Median (25分)
Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1 = { 11, 12, 13, 14 } is 12, and the median of S2 = { 9, 10, 15, 16, 17 } is...原创 2020-05-02 11:20:54 · 195 阅读 · 0 评论 -
PAT甲级刷题记录——1085 Perfect Sequence (25分)
Given a sequence of positive integers and another positive integer p. The sequence is said to be a perfect sequence if M≤m×p where M and m are the maximum and minimum numbers in the sequence, respecti...原创 2020-05-02 11:07:36 · 176 阅读 · 0 评论