博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
PAT 1009 Product of Polynomials
阅读量:2429 次
发布时间:2019-05-10

本文共 736 字,大约阅读时间需要 2 分钟。


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 information of a polynomial:

K N​1 a​N​1 N​2 aN2 … N​K a​N​K​​

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 1≤K≤10, 0≤N​K<⋯⋯<N​2<N​1​​ ≤1000.

Output Specification:

For each test case you should output the product of A and B in one line, with the same format as the input. Notice that there must be NO extra space at the end of each line. Please be accurate up to 1 decimal place.

Sample Input:

2 1 2.4 0 3.2
2 2 1.5 1 0.5
Sample Output:
3 3 3.6 2 6.0 1 1.6


转载地址:http://tsnmb.baihongyu.com/

你可能感兴趣的文章
3小时掌握数据挖掘-CSDN公开课-专题视频课程
查看>>
Web 全栈全端技术体系与软件四层结构-CSDN公开课-专题视频课程
查看>>
AI学习挑战直播课:成功案例分享及行业趋势分析-CSDN公开课-专题视频课程
查看>>
【UI/UE设计师】banner设计原则-CSDN公开课-专题视频课程
查看>>
Gin的路由
查看>>
如何安全地退出goroutine
查看>>
context.Context
查看>>
优先队列
查看>>
redis深度历险学习笔记--基础与应用篇
查看>>
单链表翻转
查看>>
检查表达式中的括号是否匹配
查看>>
一道关于 goroutine 的面试题
查看>>
信号量的使用方法
查看>>
RabbitMQ(1): docker-compose安装rabbitmq及简单使用Hello World
查看>>
is-a,has-a,like-a是什么
查看>>
简单工厂、工厂、抽象工厂的对比
查看>>
J2EE的体系架构——J2EE
查看>>
对于关系型数据库中的索引的基本理解
查看>>
索引,主键,唯一索引,联合索引的区别
查看>>
剪桌腿的最小代价
查看>>