
考研
黑火的柠檬树下快乐多
没有刷不穿的pta题库!
展开
-
PAT-甲级-1004 Counting Leaves (30 分)
A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.Input Specification:Each input file contains one test case. Each case starts...原创 2019-07-18 21:44:38 · 334 阅读 · 0 评论 -
PAT-甲级-1015 Reversible Primes (20 分)
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 pr...原创 2019-07-22 21:32:37 · 104 阅读 · 0 评论 -
PAT-甲级-1013 Battle Over Cities (25 分)
1013 Battle Over Cities (25 分)It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We...原创 2019-07-20 21:40:13 · 163 阅读 · 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), andE- Eng...原创 2019-07-20 20:09:23 · 86 阅读 · 0 评论 -
PAT-甲级-1011 World Cup Betting (20 分)
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. Si...原创 2019-07-20 20:08:45 · 123 阅读 · 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 isyes, if 6 is a decimal number and 110 is a binary number.Now for any pair of positive inte...原创 2019-07-20 20:08:00 · 127 阅读 · 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...原创 2019-07-24 21:36:32 · 128 阅读 · 0 评论 -
PAT-甲级-1007 Maximum Subsequence Sum (25 分)
Given a sequence ofKintegers {N1,N2, ...,NK}. A continuous subsequence is defined to be {Ni,Ni+1, ...,Nj} where1≤i≤j≤K. The Maximum Subsequence is the continuous subsequen...原创 2019-07-17 21:08:51 · 96 阅读 · 0 评论 -
PAT-甲级-1024 Palindromic Number (25 分)
A number that will be the same when it is written forwards or backwards is known as aPalindromic Number. For example, 1234321 is a palindromic number. All single digit numbers are palindromic numbers...原创 2019-07-24 20:48:37 · 118 阅读 · 0 评论 -
PAT-甲级-1023 Have Fun with Numbers (20 分)
Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplication. Double it we will obtain 246913578, which happens to be another 9-digit number con...原创 2019-07-24 20:16:48 · 101 阅读 · 0 评论 -
PAT-甲级-1006 Sign In and Sign Out (25 分)
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...原创 2019-07-17 20:35:32 · 191 阅读 · 0 评论 -
PAT-甲级-1005 Spell It Right (20 分)
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. Eac...原创 2019-07-17 20:13:49 · 135 阅读 · 0 评论 -
PAT-甲级-1003 Emergency (25 分)
1003 Emergency (25 分)As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams...原创 2019-07-17 20:11:11 · 146 阅读 · 0 评论 -
PAT-甲级-1009 Product of Polynomials (25 分)
1009 Product of Polynomials (25 分)This time, you are supposed to findA×BwhereAandBare two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines...原创 2019-07-19 21:32:56 · 143 阅读 · 0 评论 -
PAT-甲级-1008 Elevator (20 分)
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 sec...原创 2019-07-19 21:11:19 · 142 阅读 · 0 评论 -
PAT-甲级-1002 A+B for Polynomials (25 分)
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 informa...原创 2019-07-16 21:21:02 · 108 阅读 · 0 评论 -
PAT-甲级-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 ...原创 2019-07-16 20:19:13 · 194 阅读 · 0 评论 -
PAT-关于最短路径-Dijkstra+(DFS)
求单源或全局最短路径(无负边)-> 用Dijkstra:#include <iostream>const int inf = 999999999;cosnt int maxn = 500;int main(){ int e[maxn][maxn],dis[maxn]; fill(e[0],e[0]+maxn*maxn,inf); fill(...原创 2019-07-18 21:57:07 · 441 阅读 · 0 评论 -
PAT-甲级-1106 Lowest Price in Supply Chain (25 分)
1106Lowest Price in Supply Chain(25分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Start...原创 2019-07-26 22:26:09 · 146 阅读 · 0 评论