天南之城的后花园

记录精彩的程序人生

文章

PAT 1009 多项式乘法

1009 Product of Polynomials This time, you are supposed to find A×B where A and B are two polynomials. 这次,你需要找到两个多项式 A 和 B 的乘积。 Input Specification: Each input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial: K\quad N_1\quad a_{N1}\quad N_2\quad a_{N2}\quad...\quad N_K\quad a_{NK} where K is the number of nonzero terms in the polynomial, N_i and a_{Ni} (i=1,2,⋯,K) are the exponents and coefficients, respectively. It is given that $....

PAT 1008 电梯

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 move down one floor. The elevator will stay for 5 seconds at each stop. 我们城市最高的建筑只有一台电梯。有一个请求列表由 N 个正整数组成,这些数字指定电梯停在哪些楼层,按指定的顺序。电梯每上升一层需要 6 秒钟,每下降一层需要 4 秒钟。电梯每停留一个楼层需要 5 秒钟。 For a given request list, you are to compute the total ....

记录精彩的程序人生

© 2025 天南之城的后花园

Powered by Bolo
Theme bolo-sakura by Mashiro
浏览 67109 文章 46 评论 11
蜀ICP备2023008301号

主题 | Theme