PAT(甲级)
无知的渣渣
无论是从无知到有知,还是一个渣渣的逆袭,都是需要付出的。。。
展开
-
1002. A+B for Polynomials
This time, you are supposed to find A+B where A and B are two polynomials.InputEach input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial: K N1 aN1 N2 aN2 ... NK aNK, where K is the number原创 2017-03-11 15:29:00 · 1778 阅读 · 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 are supposed to find the ones who have unlocked and loc原创 2017-03-28 19:49:28 · 1443 阅读 · 0 评论 -
1007. Maximum Subsequence Sum (最大连续子序列)
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 subsequence which has the largest sum of its elements. For example, given原创 2017-03-28 21:38:15 · 657 阅读 · 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 length of each road between any pair of cities are marked原创 2017-03-23 20:46:52 · 445 阅读 · 0 评论 -
1005. Spell It Right
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. Each case occupies one line which contains an N (<= 10100).原创 2017-03-23 21:22:25 · 1302 阅读 · 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 seconds to move the elevator up one floor, and 4 seconds to原创 2017-04-10 11:19:16 · 265 阅读 · 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.InputEach input file contains one test case. Each case starts with a line containing 0 < N < 100, the number of nodes in a tree, and原创 2017-10-21 14:37:13 · 218 阅读 · 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 Algebra), and E - English. At the mean time, we encourage students by emphasi原创 2017-10-22 16:14:57 · 363 阅读 · 0 评论