
PAT-甲
llsong98
你必须要么就非常非常努力,要么就非常非常聪明,你才能勉强过上一种平庸的生活。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
PAT 甲 1052 链表排序 Linked List Sorting
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原创 2020-06-04 19:05:55 · 150 阅读 · 0 评论 -
PAT 甲 1032 共享链表 Sharing
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 suffix. For example, loading and being are stored as showed in Figure 1.fig原创 2020-06-04 18:08:24 · 164 阅读 · 0 评论 -
PAT 甲 1074 反转链表 Reversing Linked List
Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given L being 1→2→3→4→5→6, if K=3, then you must output 3→2→1→6→5→4; if K=4, you must output 4→3→2→1→5→6.Input Specification:Each原创 2020-06-03 16:18:03 · 167 阅读 · 0 评论 -
PAT 甲 1056 老鼠和大米 Mice and Rice
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 is to eat as much rice as possible in order to become a FatMouse.First the pl原创 2020-06-02 14:01:47 · 288 阅读 · 0 评论 -
PAT 甲 1051 弹出序列 Pop Sequence
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原创 2020-06-02 12:25:59 · 177 阅读 · 0 评论 -
PAT 甲 1073 科学计数法 Scientific Notation
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原创 2020-05-30 15:00:13 · 196 阅读 · 0 评论 -
PAT 甲 1058 霍格沃茨的 A + B A+B in Hogwarts
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-28 13:12:07 · 293 阅读 · 1 评论 -
PAT 甲1027 火星颜色 Colors in Mars
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-28 12:23:41 · 135 阅读 · 0 评论 -
PAT 甲 1019 普通回文数 General Palindromic Number
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-27 17:54:27 · 141 阅读 · 0 评论 -
PAT 甲 1031 U型 Hello World for U
Given any string of N (≥5) characters, you are asked to form the characters into the shape of U. For example, helloworld can be printed as:h de ll rlowoThat is, the characters must be printed in the original order, starting top-down from the left原创 2020-05-27 17:25:06 · 155 阅读 · 0 评论 -
PAT 甲1036 男孩 vs 女孩 Boys vs Girls
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 N, followe原创 2020-05-26 18:47:56 · 196 阅读 · 0 评论 -
PAT 甲 1006 签到与签离 Sign In and Sign Out
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原创 2020-05-26 18:18:19 · 429 阅读 · 0 评论 -
PAT 甲 1011 世界杯投注 World Cup Betting
With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battles for the World Cup trophy in South Africa. Similarly, football betting fans were putting their money原创 2020-05-26 13:02:19 · 698 阅读 · 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 information of a polynomial:K N 1 a N 1 N 2 a N原创 2020-05-25 18:53:09 · 157 阅读 · 0 评论 -
PAT 甲 1009 多项式乘积 Product of 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 information of a polynomial:K N 1 a N 1 N 2 a N原创 2020-05-25 15:44:40 · 241 阅读 · 0 评论 -
PAT 甲 1065 A+B and C
Given three integers A, B and C in [−2^63, 2^63], you are supposed to tell whether A+B>C.Input Specification:The first line of the input gives the positive number of test cases, T (≤10). Then T test cases follow, each consists of a single line contai原创 2020-05-25 12:15:51 · 194 阅读 · 0 评论 -
PAT 甲 1046 最短距离 Shortest Distance
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:Each input file contains one test case. For each case, the first line contains原创 2020-05-25 11:52:23 · 176 阅读 · 0 评论 -
PAT 甲 1042 洗牌机 Shuffling Machine
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 collaborate with gamblers by performing inadequate shuffles, many casinos employ原创 2020-05-24 23:41:49 · 275 阅读 · 0 评论 -
PAT 甲 1060 Are They Equal
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 sig...原创 2020-03-28 08:43:22 · 110 阅读 · 0 评论 -
PAT 甲 1063 Set Similarity
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 is the total number of distinct n...原创 2020-03-27 17:47:53 · 105 阅读 · 0 评论 -
PAT 甲 1047 Student List for Course
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 the courses.Input Sp...原创 2020-03-25 23:11:20 · 195 阅读 · 1 评论 -
PAT 甲 1039 Course List for Student
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 ...原创 2020-03-24 22:00:09 · 145 阅读 · 0 评论 -
PAT 甲 1108 Finding Average
The basic task is simple: given N real numbers, you are supposed to calculate their average. But what makes it complicated is that some of the input numbers might not be legal. A legal input is a real...原创 2020-03-24 21:02:22 · 86 阅读 · 0 评论 -
PAT 甲 1077 Kuchiguse
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 ...原创 2020-03-23 23:07:15 · 170 阅读 · 0 评论 -
PAT 甲 1073 Scientific Notation
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 intege...原创 2020-03-23 21:56:53 · 143 阅读 · 0 评论 -
PAT 甲 1061 Dating
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-03-23 11:08:43 · 158 阅读 · 0 评论 -
PAT 甲 1035 Password
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 ...原创 2020-03-22 23:03:26 · 143 阅读 · 0 评论 -
PAT 甲 1005 Spell It Right
Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English.Input Specification:Each input file contains one test case. Each ...原创 2020-03-21 22:36:33 · 99 阅读 · 0 评论 -
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 fil...原创 2020-03-21 14:31:09 · 140 阅读 · 0 评论 -
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...原创 2020-02-16 21:18:58 · 124 阅读 · 0 评论