PTA Advanced
VargrantS
吃喝玩乐,写代码
展开
-
1005 Spell It Right
Given a non-negative integer NNN, your task is to compute the sum of all the digits of NNN, and output every digit of the sum in English.Input Specification:Each input file contains one test case. E...原创 2019-08-02 16:54:09 · 86 阅读 · 0 评论 -
1015 Reversible Primes
A reversible prime in 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-08-16 15:52:29 · 143 阅读 · 0 评论 -
1014 Waiting in Line
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 spac...原创 2019-08-16 15:46:10 · 165 阅读 · 0 评论 -
1004 Counting Leaves
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 w...原创 2019-08-01 21:29:26 · 82 阅读 · 0 评论 -
1003 Emergency
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-08-01 21:20:37 · 92 阅读 · 0 评论 -
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 informati...原创 2019-08-01 21:10:12 · 90 阅读 · 0 评论 -
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...原创 2019-08-01 21:00:51 · 92 阅读 · 0 评论 -
1013 Battle Over Cities
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-08-04 23:40:40 · 112 阅读 · 0 评论 -
1012 The Best Rank
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-08-04 23:06:25 · 114 阅读 · 0 评论 -
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. Si...原创 2019-08-04 22:41:50 · 95 阅读 · 0 评论 -
1010 Radix
Given a pair of positive integers, for example, 666 and 110110110, can this equation 6=1106 = 1106=110 be true? The answer is yes, if 666 is a decimal number and 110110110 is a binary number.Now for ...原创 2019-08-04 17:18:04 · 118 阅读 · 0 评论 -
1009 Product of Polynomials
This time, you are supposed to find A×BA×BA×B where AAA and BBB are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and each line contains the...原创 2019-08-02 17:16:24 · 120 阅读 · 0 评论 -
1008 Elevator
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-08-02 17:07:03 · 100 阅读 · 0 评论 -
1007 Maximum Subsequence Sum
Given a sequence of K integers N1,N2,...,NK{ N_1, N_2, ..., N_K }N1,N2,...,NK. A continuous subsequence is defined to be Ni,Ni+1,...,Nj{ N_i, N_{i+1}, ..., N_j...原创 2019-08-02 17:05:04 · 83 阅读 · 0 评论 -
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...原创 2019-08-02 16:59:15 · 100 阅读 · 0 评论 -
1016 Phone Bills
A long-distance telephone company charges its customers by the following rules:Making a long-distance call costs a certain amount per minute, depending on the time of day when the call is made. When ...原创 2019-09-07 22:08:00 · 143 阅读 · 0 评论