PAT甲级
文章平均质量分 90
Y_CanFly
拿着相机写代码
展开
-
【PAT甲级】1001 A+B Format
Calculate a+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 ...原创 2018-10-29 20:06:45 · 86 阅读 · 0 评论 -
【PAT甲级】1041 Be Unique(散列)
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 o...原创 2018-11-02 13:07:49 · 218 阅读 · 0 评论 -
【PAT甲级】1048 Find Coins(散列/二分)
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,...原创 2018-11-02 13:15:04 · 242 阅读 · 0 评论 -
【PAT甲级】1050 String Subtraction(散列)
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 given s...原创 2018-11-02 13:21:06 · 177 阅读 · 0 评论 -
【PAT甲级】1084 Broken Keyboard(散列)
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...原创 2018-11-02 13:31:27 · 249 阅读 · 1 评论 -
【PAT甲级】1092 To Buy or Not to Buy(散列)
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...原创 2018-11-02 13:39:13 · 169 阅读 · 0 评论 -
【PAT甲级】1038 Recover the Smallest Number(贪心+排序)
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...原创 2018-11-07 12:37:00 · 307 阅读 · 1 评论 -
【PAT甲级】1067 Sort with Swap(0, i)(贪心)
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...原创 2018-11-07 14:57:57 · 534 阅读 · 1 评论 -
【PAT甲级】1070 Mooncake(贪心)
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 ...原创 2018-11-07 15:07:18 · 206 阅读 · 0 评论 -
【PAT甲级】1010 Radix(二分法)
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 inte...原创 2018-11-13 19:27:35 · 168 阅读 · 0 评论 -
【PAT甲级】1044 Shopping in Mars(二分法)
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 ...原创 2018-11-13 19:45:15 · 272 阅读 · 0 评论 -
【PAT甲级】1085 Perfect Sequence(二分法)
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 Mand m are the maximum and minimum numbers in the sequence, respectiv...原创 2018-11-13 20:01:12 · 197 阅读 · 0 评论 -
【PAT甲级】1037 Magic Coupon(贪心)
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...原创 2018-11-06 21:33:31 · 274 阅读 · 0 评论 -
【PAT甲级】1033 To Fill or Not to Fill(贪心)
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 to time. Different ga...原创 2018-11-06 21:01:09 · 318 阅读 · 0 评论 -
【PAT甲级】1002 A+B for Polynomials
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 informa...原创 2018-10-29 20:13:55 · 109 阅读 · 0 评论 -
【PAT甲级】1016 Phone Bills
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...原创 2018-10-31 12:13:19 · 1659 阅读 · 2 评论 -
【PAT甲级】1025 PAT Ranking
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...原创 2018-10-31 12:53:50 · 143 阅读 · 0 评论 -
【PAT甲级】1028 List Sorting
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...原创 2018-10-31 15:15:49 · 118 阅读 · 0 评论 -
【PAT甲级】1055 The World's Richest
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...原创 2018-10-31 18:45:38 · 241 阅读 · 0 评论 -
【PAT甲级】1062 Talent and Virtue
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...原创 2018-10-31 19:19:34 · 161 阅读 · 0 评论 -
【PAT甲级】1075 PAT Judge
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 co...原创 2018-11-01 11:22:54 · 305 阅读 · 0 评论 -
【PAT甲级】1083 List Grades
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 ...原创 2018-11-01 11:51:02 · 102 阅读 · 0 评论 -
【PAT甲级】1080 Graduate Admission
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...原创 2018-11-01 13:01:01 · 147 阅读 · 0 评论 -
【PAT甲级】1012 The Best Rank
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 - Eng...原创 2018-10-30 21:10:05 · 114 阅读 · 0 评论 -
【PAT甲级】1095 Cars on Campus
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...原创 2018-11-01 20:05:39 · 690 阅读 · 0 评论 -
【PAT甲级】1029 Median
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...原创 2019-09-29 11:08:49 · 144 阅读 · 0 评论