PTA甲级
少女情怀总是诗mmm
人生目标——成为一个富有的老姑娘
展开
-
PTA-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 informa...原创 2019-07-08 20:11:57 · 185 阅读 · 0 评论 -
PTA-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 must know immediately if we nee...原创 2019-07-30 09:13:01 · 163 阅读 · 0 评论 -
PTA-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), and E - Eng...原创 2019-07-30 09:10:13 · 191 阅读 · 0 评论 -
PTA-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-30 09:04:58 · 367 阅读 · 0 评论 -
PTA-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 subsequen...原创 2019-07-12 16:14:42 · 159 阅读 · 0 评论 -
PTA-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-12 16:10:14 · 199 阅读 · 0 评论 -
PTA-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. Eac...原创 2019-07-12 16:05:28 · 156 阅读 · 0 评论 -
PTA-1010 Radix (25 分)(部分正确)
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...原创 2019-07-14 11:53:59 · 314 阅读 · 0 评论 -
PTA-1009 Product of 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 informa...原创 2019-07-14 11:41:56 · 167 阅读 · 0 评论 -
PTA-1008 Elevator (20 分)
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 will stop, in specified order. It costs 6 sec...原创 2019-07-14 11:33:20 · 164 阅读 · 0 评论 -
PTA-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 in each city and the l...原创 2019-07-08 21:06:47 · 198 阅读 · 0 评论 -
PTA-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 input ...原创 2019-07-08 19:18:20 · 283 阅读 · 0 评论 -
PTA-1014 Waiting in Line (30 分)
Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rules for the customers to wait in line are: The space...原创 2019-07-30 09:26:02 · 193 阅读 · 0 评论