PAT甲级
哇吖吖
记录我的学习之路
展开
-
1036 Boys vs Girls (25分)
Description: 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 integ原创 2020-09-28 09:15:34 · 109 阅读 · 0 评论 -
1049 Counting Ones (30分)
Description: 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, there are five 1’s in 1, 10, 11, and 12. Input Specification: E原创 2020-09-26 15:10:34 · 52 阅读 · 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 g...原创 2020-04-30 12:37:14 · 62 阅读 · 0 评论 -
PAT 甲级 1009 Product of Polynomials (25分)——map容器的应用
题目描述: 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 inf...原创 2020-04-26 18:50:51 · 79 阅读 · 0 评论 -
PAT 甲级 1006 Sign In and Sign Out (25分)——sort函数的应用
题意描述: 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’...原创 2020-04-23 12:38:45 · 60 阅读 · 0 评论 -
PAT 甲级 1007 Maximum Subsequence Sum (25分)——动态规划
题目描述: Given a sequence of K integers { N1, N2, …, NK }. A continuous subsequence is defined to be { Ni, Ni+1, …, Nj } where 1≤i≤j≤K. The Maximum Subsequence is the continuous subsequ...原创 2020-04-23 11:59:16 · 85 阅读 · 0 评论 -
PAT 甲级 1021 Deepest Root (25分)——含证明
思路: 先任意选择一个结点,从该结点开始遍历整棵树,获取能达到的最深的顶点(记为集合A);然后从集合A中任意一个结点开始遍历整棵树,获取能达到的最深的顶点(记为集合B);集合A与集合B的并集即为使树高最大的根结点。 set容器内元素的特点为自动有序(默认为从小到大)且不含重复元素 题目描述: A graph which is connected and acyclic can be con...原创 2020-04-23 10:53:22 · 96 阅读 · 0 评论 -
PAT 甲级 1008 Elevator (20分)
学个单词 单词 汉意 denote 标志; 象征; 表示; 题目描述: The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator...原创 2020-04-21 21:02:40 · 72 阅读 · 0 评论 -
PAT 甲级 1028 List Sorting (25分)——sort的应用
题目描述: 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...原创 2020-04-21 19:00:03 · 110 阅读 · 0 评论 -
PAT甲级 1031 Hello World for U (20分)——用vector的遍历输出图形
题目描述: 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 d e l l r lowo That is, the characters must be p...原创 2020-04-21 17:47:16 · 79 阅读 · 0 评论 -
PAT 甲级 1039 Course List for Student (25分)——map、set混合双打
题目描述: 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...原创 2020-04-20 18:28:00 · 90 阅读 · 0 评论 -
PAT 甲级 1022 Digital Library (30分) —— map、string等的应用
题目描述: 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 n...原创 2020-04-20 17:46:39 · 114 阅读 · 0 评论 -
PAT 甲级 1005 Spell It Right (20分)
题目描述: 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...原创 2020-04-20 16:56:43 · 89 阅读 · 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 (L...原创 2020-04-20 15:24:23 · 86 阅读 · 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 rankl...原创 2020-04-20 14:51:33 · 80 阅读 · 0 评论 -
PAT 甲级 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 in...原创 2020-04-19 15:24:44 · 59 阅读 · 0 评论 -
PAT 甲级1001 A+B Format (20分)
题目描述: 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 in...原创 2020-04-19 14:52:16 · 100 阅读 · 0 评论