PTA甲级
文章平均质量分 69
worldinme
这个作者很懒,什么都没留下…
展开
-
pta甲级1059 Prime Factors (AC)
Given any positive integerN, you are supposed to find all of its prime factors, and write them in the formatN=p1k1×p2k2×⋯×pmkm.Input Specification:Each input file contains one test case which gives a positive integerNin the range oflong i...原创 2021-11-10 22:55:43 · 95 阅读 · 0 评论 -
pta甲级1010 Radix(好多坑,人麻了)
Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer isyes, if 6 is a decimal number and 110 is a binary number.Now for any pair of positive integersN1andN2, your task is to find the radix of one...原创 2021-11-04 08:21:11 · 194 阅读 · 0 评论 -
pta甲级1008 Elevator(AC)
The highest building in our city has only one elevator. A request list is made up withNpositive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator up one floor, and 4 seconds t...原创 2021-11-01 19:59:28 · 143 阅读 · 0 评论 -
pta甲级1015 Reversible Primes(AC)
Areversible primein any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a reversible prime because its reverse 37 is also a prime.Now given any two positive integersN(<105) a...原创 2021-10-31 08:52:22 · 101 阅读 · 0 评论 -
pta甲级1001 A+B Format(AC)
1001 A+B Format (20 分)Calculatea+band 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. Ea..原创 2021-10-20 19:24:26 · 157 阅读 · 0 评论 -
pta甲级1002 A+B for Polynomials(AC)
This time, you are supposed to findA+BwhereAandBare 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:KN1aN1N2aN2...NKaN...原创 2021-10-21 22:54:39 · 89 阅读 · 0 评论 -
pta甲级1005 Spell It Right(AC)
Given a non-negative integerN, your task is to compute the sum of all the digits ofN, 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 anN(≤10100)....原创 2021-10-30 08:38:46 · 93 阅读 · 0 评论 -
pta甲级1025 PAT Ranking(AC)
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 you.原创 2021-10-24 18:04:37 · 95 阅读 · 0 评论 -
pta甲级1032 Sharing(AC)
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,loadingandbeingare stored as showed in Figure 1....原创 2021-10-22 19:55:06 · 136 阅读 · 0 评论 -
pta甲级1093 Count PAT‘s(AC)
The stringAPPAPTcontains twoPAT'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 given any string, you are supposed to tell the number o...原创 2021-10-30 08:04:47 · 87 阅读 · 0 评论 -
pta甲级1101 Quick Sort(AC)(检测点2的格式错误要你输出换行就很奇怪)
There is a classical process namedpartitionin 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 left and those larger than the pivot to its right. Given...原创 2021-10-29 14:49:15 · 212 阅读 · 0 评论