天南之城的后花园

记录精彩的程序人生

文章

PAT 1002 两多项式相加

1002 A+B for 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 N_1 a_{N1} N_2 a_{N2} ... N_{K} a_{NK} where K is the number of nonzero terms in the polynomial, N_{i} and a_{Ki} (i=1,2,⋯,K) are the exponents and coefficients, respectively. It is given that 1≤K≤10 , 0≤N_{K}<⋯<N_{2}<N_{1}....

记录精彩的程序人生

© 2025 天南之城的后花园

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

主题 | Theme